啟動(dòng)vue ui 使用npm? run? serve編譯啟動(dòng)時(shí) , 出現(xiàn)以下問題:
Compiled with problems:
x
ERROR
Cannot read properties of undefined (reading 'use') TypeError: Cannot read properties of undefined (reading 'use') at eval (webpack-internal:///./src/plugins/element.js:13:45) at ./src/plugins/element.js (http://localhost:8080/js/app.js:96:1) at webpack_require (http://localhost:8080/js/app.js:337:33) at fn (http://localhost:8080/js/app.js:592:21) at eval (webpack-internal:///./src/main.js:5:77) at ./src/main.js (http://localhost:8080/js/app.js:85:1) at webpack_require (http://localhost:8080/js/app.js:337:33) at http://localhost:8080/js/app.js:1517:109 at webpack_require.O (http://localhost:8080/js/app.js:383:23) at http://localhost:8080/js/app.js:1518:53
錯(cuò)誤截圖如下:
文章來源:http://www.zghlxwxcb.cn/news/detail-435945.html
?解決方法:?
1. 重新創(chuàng)建一個(gè)新項(xiàng)目
2. 重新安裝依賴. 出現(xiàn)這個(gè)問題我是因?yàn)槲业囊蕾嚊]有安裝好
npm install -g vue 安裝全局vue
npm install -g @vue/cli 安裝vue腳手架 ,加一個(gè)@是最新的版本
3. 修改main.js里面代碼? ?導(dǎo)入包的方式不對(duì)
import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
const app = createApp(App)
app.use(router).mount('#app')
定義一個(gè)變量去存,使用變量去調(diào)用文章來源地址http://www.zghlxwxcb.cn/news/detail-435945.html
到了這里,關(guān)于完美解決 Compiled with problems: × ERROR Cannot read properties of undefined (readin的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!