解决方法一:
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'
}
推荐第二种方法。