2026-01-26 13:47:53 +08:00
|
|
|
import { createApp } from 'vue'
|
|
|
|
|
import App from './App.vue'
|
|
|
|
|
|
2026-01-26 17:00:12 +08:00
|
|
|
// 1. 引入路由配置 (确保你已经创建了 src/router/index.ts)
|
|
|
|
|
import router from './router'
|
|
|
|
|
|
|
|
|
|
// 2. 引入 Element Plus (UI组件库)
|
|
|
|
|
import ElementPlus from 'element-plus'
|
|
|
|
|
import 'element-plus/dist/index.css'
|
|
|
|
|
// 引入中文包
|
|
|
|
|
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
|
|
|
|
|
|
|
|
// 3. 引入图标
|
|
|
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
|
|
|
|
|
|
|
|
const app = createApp(App)
|
|
|
|
|
|
|
|
|
|
// 注册所有图标
|
|
|
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
|
|
|
app.component(key, component)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 使用插件
|
|
|
|
|
app.use(router)
|
|
|
|
|
app.use(ElementPlus, {
|
|
|
|
|
locale: zhCn, // 设置为中文
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
app.mount('#app')
|