2025-09-19 14:25:20 +08:00
|
|
|
import { createApp } from 'vue';
|
|
|
|
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
|
|
|
import ElementPlus from 'element-plus';
|
|
|
|
|
import 'element-plus/dist/index.css';
|
|
|
|
|
|
|
|
|
|
import App from './App.vue';
|
|
|
|
|
import Home from './components/Home.vue';
|
2025-09-19 14:38:47 +08:00
|
|
|
import DeviceList from './components/DeviceList.vue';
|
|
|
|
|
import PlanList from './components/PlanList.vue';
|
2025-09-19 14:25:20 +08:00
|
|
|
|
|
|
|
|
// 导入全局样式
|
|
|
|
|
import './assets/styles/main.css';
|
|
|
|
|
|
|
|
|
|
// 配置路由
|
|
|
|
|
const routes = [
|
|
|
|
|
{ path: '/', component: Home },
|
2025-09-19 14:38:47 +08:00
|
|
|
{ path: '/devices', component: DeviceList },
|
|
|
|
|
{ path: '/plans', component: PlanList }
|
2025-09-19 14:25:20 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
|
history: createWebHistory(),
|
|
|
|
|
routes
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 创建Vue应用实例
|
|
|
|
|
const app = createApp(App);
|
|
|
|
|
|
|
|
|
|
// 使用Element Plus组件库
|
|
|
|
|
app.use(ElementPlus);
|
|
|
|
|
|
|
|
|
|
// 使用路由
|
|
|
|
|
app.use(router);
|
|
|
|
|
|
|
|
|
|
// 初始化服务(示例)
|
|
|
|
|
// app.config.globalProperties.$api = ApiService;
|
|
|
|
|
// app.config.globalProperties.$utils = Utils;
|
|
|
|
|
|
|
|
|
|
// 挂载应用
|
|
|
|
|
app.mount('#app');
|