main.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {createApp} from 'vue'
  2. import ElementPlus 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 './assets/style/common.scss' // 公共css
  7. import App from './App.vue'
  8. import store from './store'
  9. import router, {addRoutes} from './router'
  10. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  11. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  12. import JsonViewer from "vue3-json-viewer";
  13. import "vue3-json-viewer/dist/index.css";
  14. import DataVVue3 from '@kjgl77/datav-vue3'
  15. import VXETable from 'vxe-table'
  16. import 'vxe-table/lib/style.css'
  17. import print from 'vue3-print-nb'
  18. import VElBtn from "@/directives/v-el-btn";
  19. import VTitle from "@/directives/v-title";
  20. addRoutes()
  21. const app = createApp(App)
  22. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  23. app.component(key, component)
  24. }
  25. VXETable.setup({
  26. version: 0,
  27. zIndex: 99999, // 想多高就设置多高
  28. table: {
  29. autoResize: true
  30. }
  31. })
  32. app.use(ElementPlus, {locale: zhCn, size: store.state.app.elementSize})
  33. app.use(store)
  34. app.use(router)
  35. app.use(DataVVue3)
  36. app.directive('el-btn', VElBtn)
  37. app.directive('title', VTitle)
  38. app.use(print)
  39. app.use(VXETable)
  40. app.use(JsonViewer);
  41. app.mount('#app')