【ESLint语法报错】The “userVip“ component has been registered but not used vue/no-unused-components

【报错】

The "userVip" component has been registered but not used  vue/no-unused-components

【原因】

vue中注册的components(组件)没有在html中使用,编译器会报“组件注册了但是未使用”的错误

【解决】

找到package.json文件中的eslintConfig下的rules,增加代码:

    "rules": {
      "vue/no-unused-components": "off", // 当存在定义而未使用的组件时,关闭报错
      "no-unused-vars":"off" // 当存在定义而未使用的变量时,关闭报错

      "no-mixed-spaces-and-tabs":0 当存在多余空格时,关闭报错
    }

猜你喜欢

转载自blog.csdn.net/qq_54639969/article/details/132008409