Appearance
vue/multi-word-component-names
要求组件名称始终为多字
- ⚙️ 此规则包含在
"plugin:vue/essential"
、*.configs["flat/essential"]
、"plugin:vue/vue2-essential"
、*.configs["flat/vue2-essential"]
、"plugin:vue/strongly-recommended"
、*.configs["flat/strongly-recommended"]
、"plugin:vue/vue2-strongly-recommended"
、*.configs["flat/vue2-strongly-recommended"]
、"plugin:vue/recommended"
、*.configs["flat/recommended"]
、"plugin:vue/vue2-recommended"
和*.configs["flat/vue2-recommended"]
中。
📖 规则详情
此规则要求组件名称始终为多词,根 App
组件和 Vue 提供的内置组件(如 <transition>
或 <component>
)除外。这可以防止与现有和未来的 HTML 元素发生冲突,因为所有 HTML 元素都是单个单词。
¥This rule require component names to be always multi-word, except for root App
components, and built-in components provided by Vue, such as <transition>
or <component>
. This prevents conflicts with existing and future HTML elements, since all HTML elements are single words.
🔧选项
¥🔧 Options
json
{
"vue/multi-word-component-names": ["error", {
"ignores": []
}]
}
ignores
(string[]
) ...要忽略的组件名称。设置要允许的组件名称。¥
ignores
(string[]
) ... The component names to ignore. Sets the component name to allow.
ignores: ["Todo"]
👫相关规则
¥👫 Related Rules
📚扩展阅读
¥📚 Further Reading
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v7.20.0
¥This rule was introduced in eslint-plugin-vue v7.20.0
🔍代码实现
¥🔍 Implementation