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.

45 lines
1.2 KiB

6 months ago
6 months ago
3 months ago
6 months ago
6 months ago
6 months ago
6 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. // 修正导入路径
  16. import {useAdminStore} from './store'
  17. import request from "@/util/request";
  18. import "./global.css";
  19. import '@/assets/css/btn.css';
  20. const app = createApp(App)
  21. const pinia = createPinia()
  22. // 全局注册 ElementPlus 图标
  23. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  24. app.component(key, component)
  25. }
  26. // 先注册组件再挂载
  27. app.component('downloadExcel', JsonExcel)
  28. app.config.globalProperties.$http = request
  29. // 使用各种插件
  30. app.use(ElementPlus, {
  31. locale: zhCn
  32. })
  33. .use(router)
  34. .use(VxeUI)
  35. .use(VxeUITable)
  36. .use(pinia)
  37. .mount('#app')
  38. // 在 app 挂载之后再使用 store
  39. const adminStore = useAdminStore()
  40. adminStore.initFromLocalStorage()