Component name "mywindowcompoent" should always be multi-word vue/multi-word-component-names
时间: 2023-12-05 13:07:35 浏览: 92
vue-component-creater-ui-UE4/UE5开发资源
根据引用,报错信息指出组件名"mywindowcompoent"应该是多个单词的,而不是一个单词。这是因为在新版本的eslint中,对组件名称进行了校验。为了规避这个报错,可以采取以下方式。根据引用中的规避方式,在项目的根目录下的.eslintrc.js文件中,可以添加以下配置:
```javascript
module.exports = {
// ...
overrides: [
{
files: ['src/views/**/*.vue'],
rules: {
'vue/multi-word-component-names': 0,
},
},
]
}
```
另外,根据引用中的配置,在项目根目录下的vue.config.js文件中,可以添加以下配置:
```javascript
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false
})
```
这样配置之后,eslint将不再对组件名进行多个单词的校验,从而规避了报错。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [error Component name “Login“ should always be multi-word vue/multi-word-component-names【已解决】](https://blog.csdn.net/qq_40374604/article/details/128785667)[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_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Eslint检验项目报错 Component name xxx should always be multi-word vue/multi-word-component-names解决...](https://blog.csdn.net/august_shi/article/details/129879133)[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_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文