element-plus/play/main.ts

16 lines
400 B
TypeScript
Raw Normal View History

import { createApp } from 'vue'
import '@element-plus/theme-chalk/src/index.scss'
2022-02-11 11:04:15 +08:00
;(async () => {
const apps = import.meta.glob('./src/*.vue')
const name = location.pathname.replace(/^\//, '') || 'App'
const file = apps[`./src/${name}.vue`]
if (!file) {
location.pathname = 'App'
return
}
const App = (await file()).default
2022-02-11 11:04:15 +08:00
const app = createApp(App)
2022-02-11 11:04:15 +08:00
app.mount('#play')
})()