这个问题困扰我这个菜鸡很久了,当我run serve的时候总是会报错Component name “xxx” should always be multi-word。
一直以为是命名的问题,可是改了又改还是不行,虽然知道肯定不是名字的问题。
INFO Starting development server...
ERROR Failed to compile with 1 error 13:23:50
/Users/mac/Desktop/mus/test1/src/components/Box.vue
1:1 error Component name "Box" should always be multi-word vue/multi-word-component-names
✖ 1 problem (1 error, 0 warnings)
原因:语法提示的锅
解决:
在 vue.config.js 中关闭语法提示
具体做法:
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false, //将这一项置为false,关闭eslint检查
})