Eslint报错: Component name “login“ should always be multi-word vue/multi-word-component-names

我定义了一个vue文件: login.vue,但是 eslint监测命名不合格,必须使用多个单词,报错如下:

在这里插入图片描述
那么怎么解决呢?

1.在.eslintrc.js中配置

module.exports = {
    
    
  ……
  overrides: [
    {
    
    
      files: ['src/views/**/*.vue'],
      rules: {
    
    
        'vue/multi-word-component-names': 0,
      },
    },
  ]
}

2.关闭eslint检测
vue.config.js 文件中加一行

module.exports = {
    
     
    lintOnSave:false, 
} 

猜你喜欢

转载自blog.csdn.net/fd2025/article/details/124605821
今日推荐