vue启动报错:Uncaught TypeError: Cannot read properties of undefined (reading ‘use‘)
vue启动报错:Uncaught TypeError: Cannot read properties of undefined (reading 'use')
·
vue项目启动后报如下错误:
猜测element-ui版本不匹配,查看package.json文档发现,自己用的是vue3,但却用了个element-ui,上网查证后发现vue3要用element-plus。下载安装后,修改原来的main.js配置:
改为如下:
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css'
const app = createApp(App)
app.use(ElementPlus)
app.use(router).mount('#app')
可以啦!
如有不足,欢迎指教!
更多推荐
已为社区贡献1条内容
所有评论(0)