Component name "Student" should always be multi-word
时间: 2023-12-05 22:46:22 浏览: 83
回答: 当出现"Component name 'Student' should always be multi-word"的错误时,这意味着组件名应该是多个单词组成的。这是为了遵循命名规范。解决这个问题的方法有两种。一种是修改组件名,使其符合命名规范,例如将"Student"改为"StudentName"或者"student-name"。另一种方法是修改配置项,关闭语法检查。在项目的根目录下找到或创建vue.config.js文件,并添加以下内容:\[1\]\[2\]\[3\]
```javascript
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false //关闭语法检查
})
```
这样就可以解决这个错误了。
#### 引用[.reference_title]
- *1* [error Component name “xxx“ should always be multi-word vue/multi-word-comp](https://blog.csdn.net/u011127019/article/details/123213103)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [Vue脚手架报错 Component name “Student“ should always be multi-word vue/multi-word-component-names](https://blog.csdn.net/qq_51612558/article/details/124329234)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文