mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-15 02:40:46 +08:00
feat(play): file doesn't exist jump to App (#5985)
* feat(play): file doesn't exist jump tp App * chore: update
This commit is contained in:
parent
b825c07865
commit
3a4f2177ba
@ -3,7 +3,12 @@ import '@element-plus/theme-chalk/src/index.scss'
|
|||||||
;(async () => {
|
;(async () => {
|
||||||
const apps = import.meta.glob('./src/*.vue')
|
const apps = import.meta.glob('./src/*.vue')
|
||||||
const name = location.pathname.replace(/^\//, '') || 'App'
|
const name = location.pathname.replace(/^\//, '') || 'App'
|
||||||
const App = (await apps[`./src/${name}.vue`]()).default
|
const file = apps[`./src/${name}.vue`]
|
||||||
|
if (!file) {
|
||||||
|
location.pathname = 'App'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const App = (await file()).default
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
app.mount('#play')
|
app.mount('#play')
|
||||||
|
Loading…
Reference in New Issue
Block a user