解决报错: error Component name “List“ should always be multi-word vue/multi-word-component-names
解决报错: error Component name "List" should always be multi-word vue/multi-word-component-names
报错情况:
ERROR Failed to compile with 1 error
[eslint]
E:\project\github\github\src\components\List.vue
38:10 error Component name "List" should always be multi-word vue/multi-word-component-names
E:\project\github\github\src\components\Search.vue
12:10 error Component name "Search" should always be multi-word vue/multi-word-component-names
✖ 2 problems (2 errors, 0 warnings)
报错如图:
出现该错误的原因是eslint的语法检查,组件的命名不合eslint的规范。
解决方法1:
修改vue.config.js里的配置:增加一个配置项:lintOnSave:false
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave:false
})
如图:
解决方法2:将命名以 驼峰命名 的方式进行重新命名
更多推荐
所有评论(0)