Vue首行报错:Component name “XXX“ should always be multi-word

在解决了Parsing error: No Babel config file detected for "XXX" 以及 The template requires child element. 的错误,新建Vue文件后,首行又出现了 Component name "XXX" should always be multi-word错误。

查找资料发现错误原因:在组件命名的时候未按照 ESLint 的官方代码规范进行命名!根据 ESLint 官方代码风格指南,除了根组件(App.vue)以外,其他自定义组件命名要使用大驼峰命名方式或者用“-”连接单词进行命名。

 于是,按照“大驼峰”方式,修改文件名后,报错消失了!

参考资料:

在 vue eslint 报错 error “Component name “*****“ should always be multi-word”,该怎么办?

猜你喜欢

转载自blog.csdn.net/qq_54727445/article/details/128378896