TypeError: Cannot read property 'props' of undefined
[Vue warn]: Failed to resolve async component: function (resolve)
遇到以上三種問題,在我的項(xiàng)目中都?xì)w結(jié)為一個(gè):就是依賴的sass-loader沒有,或者說是依賴的node-sass沒有
所以解決辦法就是
// 安裝node-sass npm i node-sass -D // 安裝sass-loader npm i sass-loader -D
在package.json查看
?{
? "devDependencies": {
? ? "node-sass": "^9.0.0",
? ? "sass-loader": "^13.3.2"
? },
?在我項(xiàng)目里是因?yàn)槭褂玫絬view-ui的組件,而這個(gè)組件是依賴sass的,所以沒有下載就會(huì)報(bào)很多錯(cuò),如果你也是用到了這個(gè)組件,那么接下來還要做。
在main.js寫入下面兩行,要注意寫在引入vue的后面
import uView from "uview-ui"
Vue.use(uView);文章來源:http://www.zghlxwxcb.cn/news/detail-702371.html
?這個(gè)時(shí)候就能正常使用組件了。文章來源地址http://www.zghlxwxcb.cn/news/detail-702371.html
到了這里,關(guān)于Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!