main.js 721 B

1234567891011121314151617181920212223242526272829303132333435
  1. import 'virtual:uno.css'
  2. //主要
  3. import { createApp } from 'vue'
  4. import setupPinia from './store/init'
  5. import router, { setupRouter } from './router'
  6. import App from './App.vue'
  7. //挂载全局
  8. import { setupComponents } from './components'
  9. import { setupInstall } from './components/install'
  10. //创建实例
  11. async function bootstrap() {
  12. const app = createApp(App)
  13. // 挂载状态管理
  14. app.use(setupPinia)
  15. // 挂载路由
  16. await setupRouter(app)
  17. // 路由准备就绪后挂载APP实例
  18. await router.isReady()
  19. // 挂载全局组件
  20. setupInstall(app)
  21. // 组件注册全局
  22. setupComponents(app)
  23. app.mount('#app')
  24. }
  25. // eslint-disable-next-line no-void
  26. void bootstrap()