31 lines
852 B
JavaScript
31 lines
852 B
JavaScript
// 引入依赖
|
|
import config from "../config/index.js";
|
|
import componentMap from "./router/component-map.js";
|
|
import AdminFramework from "./framework/admin-framework.js";
|
|
import CustomHomePage from "./views/home/index.vue";
|
|
import deviceModule from "./store/index.js";
|
|
|
|
|
|
const app = AdminFramework.createApp({
|
|
title: '我的管理系统',
|
|
apiUrl: config.apiUrl,
|
|
componentMap: componentMap,
|
|
HomePage: CustomHomePage // 可选:自定义首页组件,覆盖整个首页
|
|
})
|
|
|
|
// 手动注册 store 模块(如果框架不支持 storeModules 参数)
|
|
if (app.$store && !app.$store.hasModule(['device'])) {
|
|
app.$store.registerModule('device', deviceModule)
|
|
}
|
|
|
|
// 挂载应用
|
|
app.$mount('#app')
|
|
|
|
// 全局暴露 app 实例(方便调试)
|
|
window.app = app
|
|
window.rootVue = app
|
|
// window.framework 已在文件开头暴露,无需重复
|
|
|
|
|
|
|