33 lines
769 B
JavaScript
33 lines
769 B
JavaScript
|
|
import { createApp } from 'vue'
|
||
|
|
import App from './App.vue'
|
||
|
|
import router from './router'
|
||
|
|
import ElementPlus from 'element-plus'
|
||
|
|
import 'element-plus/dist/index.css'
|
||
|
|
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)
|
||
|
|
|
||
|
|
// 添加错误处理
|
||
|
|
app.config.errorHandler = (err, instance, info) => {
|
||
|
|
console.error('Vue错误:', err)
|
||
|
|
console.error('错误信息:', info)
|
||
|
|
console.error('组件实例:', instance)
|
||
|
|
}
|
||
|
|
|
||
|
|
// 挂载应用
|
||
|
|
try {
|
||
|
|
app.mount('#app')
|
||
|
|
console.log('Vue应用已成功挂载')
|
||
|
|
} catch (error) {
|
||
|
|
console.error('应用挂载失败:', error)
|
||
|
|
}
|
||
|
|
|