vue 常见错误
1. ERROR in ./.nuxt/client.js friendly-errors 10:13:25
Module build failed (from ./node_modules/babel-loader/lib/index.js): friendly-errors 10:13:25
Error: [BABEL] E:\vscodeWork\1010\vue-front-1010\.nuxt\client.js: Cannot find module 'E:\vscodeWork\1010\vue-front-1010\node_modules\@babel\compat-data\data\corejs3-shipped-proposals' (While processing: "E:\\vscodeWork\\1010\\vue-front-1010\\node_modules\\@nuxt\\babel-preset-app\\src\\index.js")
实际上翻译过来就是缺少依赖@babel\compat-data找到package-lock.json添加依赖即可
"dependencies": {
"nuxt": "^2.0.0",
"vue-awesome-swiper": "^3.1.3",
"@babel/compat-data": "~7.9.0"
},
2. ReferenceError: searchKey is not defined
错误原因:
在按钮中绑定了 searchKey事件
但是在定义方法时错误的使用了method,应该使用methods