main.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { createApp } from 'vue'
  2. import App from './App.vue'
  3. const app = createApp(App)
  4. import router from './router'
  5. import '@/styles/index.scss' // global css
  6. //import element-plus
  7. import ElementPlus from 'element-plus'
  8. import 'element-plus/dist/index.css'
  9. app.use(ElementPlus)
  10. // import zhCn from 'element-plus/es/locale/lang/zh-cn'
  11. // app.use(ElementPlus, { size: 'small', locale: zhCn })
  12. // global mixin
  13. // import elementMixin from '@/mixins/elementMixin'
  14. // app.mixin(elementMixin)
  15. // import commonMixin from '@/mixins/commonMixin'
  16. // app.mixin(commonMixin)
  17. // import routerMixin from '@/mixins/routerMixin'
  18. // app.mixin(routerMixin)
  19. // //import axios req
  20. // import axiosReq from '@/utils/axiosReq'
  21. // app.config.globalProperties.$axiosReq = axiosReq
  22. //svg-icon
  23. //import svg-icon doc in https://github.com/anncwb/vite-plugin-svg-icons/blob/main/README.zh_CN.md
  24. import 'virtual:svg-icons-register'
  25. import svgIcon from '@/icons/SvgIcon.vue'
  26. app.component('SvgIcon', svgIcon)
  27. //global mount moment-mini
  28. // import $momentMini from 'moment-mini'
  29. // app.config.globalProperties.$momentMini = $momentMini
  30. //import global directive(unplugin-vue-components auto scan)
  31. import directive from '@/directives'
  32. directive(app)
  33. //import router intercept
  34. import './permission'
  35. //import theme
  36. import './theme/index.scss'
  37. //import unocss
  38. import 'uno.css'
  39. //element svg icon(unplugin-vue-components auto scan)
  40. // import ElSvgIcon from '@/components/ElSvgIcon.vue'
  41. // app.component('ElSvgIcon', ElSvgIcon)
  42. //error log collection
  43. // import errorLog from '@/hooks/useErrorLog'
  44. // errorLog()
  45. //pinia
  46. import { createPinia } from 'pinia'
  47. app.use(createPinia())
  48. app.use(router).mount('#app')
  49. import elTableInfiniteScroll from 'el-table-infinite-scroll'
  50. app.use(elTableInfiniteScroll)