一、问题描述:
通过报错信息“Component name “School” should always be multi-word”可知,组件名“School”和“Student”应该总使用用横线拼接的多个单词组成的。
实际是语法检测的问题,不同人或公司的语法标准不同。一般情况下,关闭语法检测。
二、解决方法:
①在项目目录中找到vue.config.js【如果没有就自己创建】;
②在module.exports里面添加一行配置即可
lintOnSave: false, //关闭语法检查
完整代码附上
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false //关闭语法检查
})