blogger

JackS·Zhao

人生就像开车在路上走,你我只是其中的一个驾驶员。送走老的、迎来小的,匆匆看过路边风景。一直向前行驶,却不知道是谁修的这条路。
Vue项目运行报错: Component name “xxx“ should always be multi-word vue/multi-word-component-names

时间:2023-10-15    作者:JackS·Zhao    分类: 编程


ERROR
[eslint] 
D:\VSCode\vue-pm\src\components\XXX.vue
  1:1  error  Component name "XXX" should always be multi-word  vue/multi-word-component-names

✖ 1 problem (1 error, 0 warnings)

解决方案一

修改组件名,使其符合命名规范。例如:StudentName或者student-name

解决方法2:
修改配置项,关闭语法检查

1.在项目的根目录找到vue.config.js文件

在文件中添加如下代码

lintOnSave:false /关闭语法检查/

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave:false
})