main.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import './styles/app/tailwind.scss'
  2. //主要
  3. import { createApp } from 'vue'
  4. import setupPinia from './store/init'
  5. import router, { setupRouter } from './router'
  6. //import * as Sentry from '@sentry/vue'
  7. import App from './App.vue'
  8. //饿了么UI
  9. import ElementPlus from 'element-plus'
  10. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  11. import 'dayjs/locale/zh-cn'
  12. //hc-vue3-ui
  13. import HcVue3UI from 'hc-vue3-ui'
  14. import 'hc-vue3-ui/dist/index.css'
  15. import 'hc-vue3-ui/style/index.scss'
  16. //挂载全局
  17. import { setupComponents } from './global/index'
  18. //导入其它样式
  19. import './styles/app/main.scss'
  20. import './styles/app/element.scss'
  21. import './styles/app/theme.scss'
  22. //创建实例
  23. async function bootstrap() {
  24. const app = createApp(App)
  25. //目前在测试阶段,发正式版前,请注释 Sentry 监控初始化
  26. /*Sentry.init({
  27. app,
  28. dsn: 'http://054a995ed4461324b75ac84cf37b9fb8@192.168.0.109:5501/2',
  29. integrations: [
  30. new Sentry.BrowserTracing({
  31. routingInstrumentation: Sentry.vueRouterInstrumentation(router),
  32. }),
  33. new Sentry.Replay({
  34. maskAllText: false,
  35. blockAllMedia: false,
  36. }),
  37. ],
  38. tracesSampleRate: 1.0,
  39. replaysSessionSampleRate: 0.1,
  40. replaysOnErrorSampleRate: 1.0,
  41. })*/
  42. // 挂载状态管理
  43. app.use(setupPinia)
  44. // 挂载路由
  45. await setupRouter(app)
  46. // 路由准备就绪后挂载APP实例
  47. await router.isReady()
  48. // 饿了么UI框架
  49. app.use(ElementPlus, {
  50. locale: zhCn,
  51. })
  52. // hc-vue3-ui
  53. app.use(HcVue3UI)
  54. // 组件注册全局
  55. setupComponents(app)
  56. app.mount('#app')
  57. }
  58. // eslint-disable-next-line no-void
  59. void bootstrap()