mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 09:50:58 +08:00
3ab869b446
* refactor(docs): improve style and fix typo * fix(docs): dark
18 lines
361 B
TypeScript
18 lines
361 B
TypeScript
import { utoa } from '../utils'
|
|
|
|
const MAIN_FILE_NAME = 'App.vue'
|
|
|
|
export const usePlayground = (source: string) => {
|
|
const code = decodeURIComponent(source)
|
|
const originCode = {
|
|
[MAIN_FILE_NAME]: code,
|
|
}
|
|
|
|
const encoded = utoa(JSON.stringify(originCode))
|
|
const link = `https://element-plus.run/#${encoded}`
|
|
return {
|
|
encoded,
|
|
link,
|
|
}
|
|
}
|