You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. import { createApp } from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import ElementPlus from 'element-plus'
  5. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  6. import 'element-plus/dist/index.css'
  7. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  8. import './assets/css/common.css' // 引入公共CSS文件
  9. import JsonExcel from 'vue-json-excel'
  10. import { createPinia } from 'pinia'
  11. import VxeUI from 'vxe-pc-ui'
  12. import 'vxe-pc-ui/lib/style.css'
  13. import VxeUITable from 'vxe-table'
  14. import 'vxe-table/lib/style.css'
  15. const a = createApp(App)
  16. import { useAdminStore } from '../src/store'
  17. // 全局注册 ElementPlus 图标
  18. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  19. a.component(key, component)
  20. }
  21. const pinia = createPinia()
  22. // 使用 ElementPlus 和路由器
  23. a.use(ElementPlus, {
  24. locale: zhCn
  25. })
  26. .use(router)
  27. .use(VxeUI)
  28. .use(VxeUITable)
  29. .use(pinia)
  30. .mount('#app')
  31. // 恢复localStorage数据
  32. const adminStore = useAdminStore()
  33. adminStore.initFromLocalStorage()
  34. // 注册 JsonExcel 组件
  35. a.component('downloadExcel', JsonExcel)