解决方法一:
vue.config.js中添加一行。(这种方式试完还是有报错显示,但是项目可以运行。)
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave:false /*关闭语法检查*/
})
解决方法二:
.eslintrc.js中的rules中添加一行。(‘vue/multi-word-component-names’: ‘off’)
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
//关闭eslint检查文件名是否为驼峰命名
'vue/multi-word-component-names': 'off'
}
推荐第二种方法。
本文介绍了解决Vue项目中ESLint频繁报错的问题,提供了两种有效的方法:一是通过修改vue.config.js来忽略语法检查;二是直接在.eslintrc.js中调整规则设置,禁用特定的检查项。
3002

被折叠的 条评论
为什么被折叠?



