|
|
@ -12,27 +12,32 @@ import VxeUI from 'vxe-pc-ui' |
|
|
|
import 'vxe-pc-ui/lib/style.css' |
|
|
|
import VxeUITable from 'vxe-table' |
|
|
|
import 'vxe-table/lib/style.css' |
|
|
|
const a = createApp(App) |
|
|
|
import { useAdminStore } from '../src/store' |
|
|
|
// 修正导入路径
|
|
|
|
import { useAdminStore } from './store' |
|
|
|
import request from "@/util/request"; |
|
|
|
|
|
|
|
const app = createApp(App) |
|
|
|
const pinia = createPinia() |
|
|
|
|
|
|
|
// 全局注册 ElementPlus 图标
|
|
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
|
|
|
a.component(key, component) |
|
|
|
app.component(key, component) |
|
|
|
} |
|
|
|
const pinia = createPinia() |
|
|
|
|
|
|
|
// 使用 ElementPlus 和路由器
|
|
|
|
a.use(ElementPlus, { |
|
|
|
locale: zhCn |
|
|
|
// 先注册组件再挂载
|
|
|
|
app.component('downloadExcel', JsonExcel) |
|
|
|
app.config.globalProperties.$http = request |
|
|
|
|
|
|
|
// 使用各种插件
|
|
|
|
app.use(ElementPlus, { |
|
|
|
locale: zhCn |
|
|
|
}) |
|
|
|
.use(router) |
|
|
|
.use(VxeUI) |
|
|
|
.use(VxeUITable) |
|
|
|
.use(pinia) |
|
|
|
.mount('#app') |
|
|
|
.use(router) |
|
|
|
.use(VxeUI) |
|
|
|
.use(VxeUITable) |
|
|
|
.use(pinia) |
|
|
|
.mount('#app') |
|
|
|
|
|
|
|
// 恢复localStorage数据
|
|
|
|
// 在 app 挂载之后再使用 store
|
|
|
|
const adminStore = useAdminStore() |
|
|
|
adminStore.initFromLocalStorage() |
|
|
|
|
|
|
|
// 注册 JsonExcel 组件
|
|
|
|
a.component('downloadExcel', JsonExcel) |
|
|
|
adminStore.initFromLocalStorage() |