main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { createApp } from 'vue'
  2. import './assets/style/main.scss'
  3. import App from './App.vue'
  4. import router from './router/index.js'
  5. import { createPinia } from 'pinia'
  6. import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
  7. import api from '@/api/index.js'
  8. import elementPlus from 'element-plus'
  9. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  10. import locale from 'element-plus/lib/locale/lang/zh-cn'
  11. import bus from 'vue3-eventbus'
  12. import * as echarts from 'echarts'
  13. import china from 'echarts/map/json/china.json'
  14. import ArcoVue from '@arco-design/web-vue'
  15. import '@arco-design/web-vue/dist/arco.css'
  16. echarts.registerMap('china', china)
  17. const pinia = createPinia()
  18. pinia.use(piniaPluginPersistedstate)
  19. const myApp = createApp(App)
  20. myApp.config.globalProperties.$api = api
  21. myApp.config.globalProperties.$bus = bus
  22. myApp.config.globalProperties.$echarts = echarts
  23. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  24. myApp.component(key, component)
  25. }
  26. myApp
  27. .use(elementPlus, { locale, size: 'default', zIndex: 300 })
  28. .use(pinia)
  29. .use(router)
  30. .use(ArcoVue)
  31. .mount('#app')