31 lines
782 B
JavaScript
31 lines
782 B
JavaScript
import { createApp } from 'vue'
|
|
import App from './App.vue' // 引入根组件
|
|
import router from './router' // 引入路由配置
|
|
|
|
// 引入 Element Plus
|
|
import ElementPlus from 'element-plus'
|
|
import 'element-plus/dist/index.css'
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
|
|
// 引入 JSON 查看器 (用于 DataMonitor 中查看原始数据)
|
|
import JsonViewer from 'vue-json-viewer'
|
|
|
|
const app = createApp(App)
|
|
|
|
// 1. 挂载路由
|
|
app.use(router)
|
|
|
|
// 2. 挂载 Element Plus
|
|
app.use(ElementPlus)
|
|
|
|
// 3. 注册所有图标 (方便在各个组件直接使用 <Edit /> 等)
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
app.component(key, component)
|
|
}
|
|
|
|
// 4. 挂载 JSON Viewer
|
|
app.use(JsonViewer)
|
|
|
|
// 5. 挂载到 DOM
|
|
app.mount('#app')
|