vue路由报错:Component name “index“ should always be multi-word vue/multi-word-component-names

报错内容:

[eslint] 
D:\path\src\pages\index\Index.vue
  7:15  error  Component name "index" should always be multi-word  vue/multi-word-component-names
  D:\path\src\pages\index\index.vue
  7:15  error  Component name "index" should always be multi-word  vue/multi-word-component-names

✖ 2 problems (2 errors, 0 warnings)

很明显是eslint的搞出来的问题,官方文档建议组件名称写成驼峰式,例如 AppHeader.vue,但这样做不够人性化,因此需要改成忽略他的规则即可以了。
##解决方法:
项目根目录下vue.config.js文件内设置lintOnSave为false:

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

完毕!

你可能感兴趣的:(vue.js)