解决报错: error Component name "School" should always be multi-word vue/multi-word-component-names

解决报错: error Component name "School" should always be multi-word vue/multi-word-component-names

运行时遇到这个问题

自己在给组件命名时没有使用大驼峰或者'-'拼接单词,所以编译的时候报错,实际上是语法检测的问题

解决方案一:

最朴素的方式,直接改名


解决方案二:

关闭校验

在根目录下找到vue.config.js文件【没有就新建一个】,添加下面的代码




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


上两种方法都可以解决问题,亲测有效

posted @ 2022-05-24 14:08  Rins  阅读(2532)  评论(0编辑  收藏  举报