27 lines
736 B
TypeScript
27 lines
736 B
TypeScript
import './assets/main.css'
|
|
|
|
import { createApp } from 'vue'
|
|
import App from './App.vue'
|
|
import ElementPlus from 'element-plus'
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue' // 图标导入
|
|
import 'element-plus/dist/index.css'
|
|
import router from './router/router'
|
|
import axios from 'axios'
|
|
|
|
const app = createApp(App)
|
|
|
|
// 全局注册所有Element Plus图标
|
|
Object.keys(ElementPlusIconsVue).forEach(key => {
|
|
// 使用类型断言确保类型正确
|
|
app.component(key, (ElementPlusIconsVue as Record<string, any>)[key])
|
|
})
|
|
|
|
// 安装插件
|
|
app.use(router)
|
|
.use(ElementPlus)
|
|
|
|
// 全局使用axios挂载到app.config.globalProperties
|
|
app.config.globalProperties.$axios = axios
|
|
|
|
// 挂载应用
|
|
app.mount('#app') |