main.ts 994 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { createApp } from 'vue'
  2. import naive from 'naive-ui'
  3. import { setupNaive, setupDirectives } from '@/plugins'
  4. import { directive } from '@/utils/directive'
  5. import './style.css'
  6. import App from './App.vue'
  7. import router, { setupRouter } from './router'
  8. import { setupStore } from '@/store'
  9. import VueUeditorWrap from 'vue-ueditor-wrap'
  10. async function bootstrap() {
  11. const app = createApp(App)
  12. // 注册全民指令
  13. directive(app)
  14. // 注册全局常用的 naive-ui 组件
  15. setupNaive(app)
  16. // 注册全局自定义组件
  17. //setupCustomComponents();
  18. // 注册全局自定义指令,如:v-permission权限指令
  19. setupDirectives(app)
  20. // 注册全局方法,如:app.config.globalProperties.$message = message
  21. // setupGlobalMethods(app)
  22. // 挂载状态管理
  23. setupStore(app)
  24. app.use(VueUeditorWrap)
  25. // 挂载路由
  26. await setupRouter(app)
  27. // 路由准备就绪后挂载APP实例
  28. await router.isReady()
  29. app.mount('#app', true)
  30. }
  31. void bootstrap()