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:vscodeWork1010vue-front-1010.nuxtclient.js: Cannot find module 'E:vscodeWork1010vue-front-1010 ode_modules@babelcompat-datadatacorejs3-shipped-proposals' (While processing: "E:\vscodeWork\1010\vue-front-1010\node_modules\@nuxt\babel-preset-app\src\index.js")

实际上翻译过来就是缺少依赖@babelcompat-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
原文地址:https://www.cnblogs.com/spx88/p/14509951.html