error Component name "Student" should always be multi-word vue/multi-word-component-names
时间: 2023-12-05 19:07:35 浏览: 199
Vue-student
这个错误信息意味着组件名"Student"应该总是使用多个单词拼接横线组成的。[1] 这是为了符合Vue的命名规范。解决这个问题的方法有几种。第一种是修改组件名,使其符合命名规范,例如改为"StudentName"或者"student-name"。第二种方法是修改配置项,关闭语法检查,这样就不会再报错了。可以在vue.config.js中添加以下代码来实现关闭语法检查:
```javascript
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false //关闭语法检查
})
```
如果以上方法还不能解决问题,你还可以尝试暴力一点的方法,直接删除组件中的name属性。这样就可以解决这个错误了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [vue脚手架报错Component name “Student“ should always be multi-word vue/multi-word-component-names](https://blog.csdn.net/qq_44727672/article/details/127899262)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文