main.ts 408 B

123456789101112131415
  1. import { createApp } from 'vue'
  2. import '@element-plus/theme-chalk/src/dark/css-vars.scss'
  3. ;(async () => {
  4. const apps = import.meta.glob('./src/*.vue')
  5. const name = location.pathname.replace(/^\//, '') || 'App'
  6. const file = apps[`./src/${name}.vue`]
  7. if (!file) {
  8. location.pathname = 'App'
  9. return
  10. }
  11. const App = (await file()).default
  12. const app = createApp(App)
  13. app.mount('#play')
  14. })()