error Component name "Login" should always be multi-word vue/multi-word-compon

1,361 阅读1分钟

eslint报错

 error  Component name "Login" should always be multi-word  vue/multi-word-component-names

原因:意思是组件命名不规范,组件的名称不是多单词组成的

解决办法有两种:

  1. 将组件的名称改为多单词的,如把Login改为LoginView

  2. vue.config.js 文件中关闭校验,配置文件中添加 lintOnSave: false

     const { defineConfig } = require('@vue/cli-service')
     module.exports = defineConfig({
       transpileDependencies: true,
       lintOnSave: false // 关闭保存时校验
     })