main.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import {createApp} from 'vue'
  2. import ElementPlus, {useZIndex, ClickOutside, TrapFocus} from 'element-plus'
  3. import 'element-plus/dist/index.css'
  4. import 'element-plus/theme-chalk/dark/css-vars.css'
  5. import 'normalize.css' // css初始化
  6. import '../src/css/app.scss' // 公共css
  7. import App from './App.vue'
  8. import router from './router'
  9. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  10. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  11. import JsonViewer from "vue3-json-viewer";
  12. import "vue3-json-viewer/dist/index.css";
  13. import DataVVue3 from '@kjgl77/datav-vue3'
  14. import VXETable from 'vxe-table'
  15. import 'vxe-table/lib/style.css'
  16. import print from 'vue3-print-nb'
  17. import VElBtn from "@/directives/v-el-btn";
  18. import VTitle from "@/directives/v-title";
  19. import "driver.js/dist/driver.css";
  20. import DomZIndex from 'dom-zindex'
  21. import initVxeConfig from "@/utils/xe-utils-enhance/vxe-formatter";
  22. import VWaves from "@/directives/v-waves";
  23. import piniaInstall from "@/pinia/pinia-install";
  24. import VxeUIPluginRenderChart from '@vxe-ui/plugin-render-chart'
  25. import '@vxe-ui/plugin-render-chart/dist/style.css'
  26. import VxeUI from 'vxe-pc-ui'
  27. import 'vxe-pc-ui/lib/style.css'
  28. import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx'
  29. import ExcelJS from 'exceljs'
  30. DomZIndex.getNext = () => {
  31. return useZIndex().nextZIndex()
  32. }
  33. DomZIndex.getCurrent = () => {
  34. return useZIndex().currentZIndex.value
  35. }
  36. initVxeConfig()
  37. const app = createApp(App)
  38. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  39. app.component(key, component)
  40. }
  41. piniaInstall(app)
  42. app.use(ElementPlus, {locale: zhCn, size: 'small'})
  43. app.use(DataVVue3)
  44. app.directive('el-btn', VElBtn)
  45. app.directive('title', VTitle)
  46. app.directive('ClickOutside', ClickOutside)
  47. app.directive('Waves', VWaves)
  48. app.directive('TrapFocus', TrapFocus)
  49. app.use(print)
  50. app.use(VxeUI)
  51. app.use(VXETable)
  52. VxeUI.use(VxeUIPluginRenderChart)
  53. VxeUI.use(VxeUIPluginExportXLSX, {
  54. ExcelJS
  55. })
  56. app.use(JsonViewer);
  57. app.use(router)
  58. app.mount('#app')