vue3报错 Component name “Footer“ should always be multi-word

报错内容

shell 复制代码
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
ERROR in [eslint] 
/Users/soul/projects/learning-vuejs3/chapter07/01_learn_component/src/01_seperate/Footer.vue
  1:1  error  Component name "Footer" should always be multi-word  vue/multi-word-component-names

/Users/soul/projects/learning-vuejs3/chapter07/01_learn_component/src/01_seperate/Header.vue
  1:1  error  Component name "Header" should always be multi-word  vue/multi-word-component-names

/Users/soul/projects/learning-vuejs3/chapter07/01_learn_component/src/01_seperate/Main.vue
  1:1  error  Component name "Main" should always be multi-word  vue/multi-word-component-names

✖ 3 problems (3 errors, 0 warnings)

解决办法

修改配置文件 .eslintrc.js ,在rules中加入这一段。

shell 复制代码
// 关闭名称校验
'vue/multi-word-component-names': "off" 

修改之后需要重新启动npm run serve

相关推荐
上单带刀不带妹1 分钟前
Vue3 全局 API 转移详解
前端·javascript·vue.js·vue3·api
乱飞的秋天4 分钟前
C++中的特殊成员函数
开发语言·c++
史上最菜开发10 分钟前
a-input输入框,苹果电脑(MAC)输入法的输入Bug
vue.js·macos·bug
怕冷的火焰(~杰)12 分钟前
yarn安装electron和better-sqlite3失败问题(rebuild:better-sqlite3)
前端·javascript·electron
小严家22 分钟前
Flutter完整开发指南 | Flutter&Dart – The Complete Guide
开发语言·flutter
宇宙的尽头是PYTHON29 分钟前
用生活中的实例解释java的类class和方法public static void main
java·开发语言·生活
摸鱼的春哥40 分钟前
“全栈模式”必然导致“质量雪崩”!和个人水平关系不大
前端·javascript·后端
道传科技上位机1 小时前
C# 循环和条件用法大全(while dowhile for foreach if Switch try)全站最全
开发语言·c#
寻星探路1 小时前
Java EE初阶启程记04---线程的状态
java·开发语言·jvm·java-ee
努力也学不会java1 小时前
【Java并发】揭秘Lock体系 -- 深入理解ReentrantLock
java·开发语言·人工智能·python·机器学习·reentrantlock