Appearance
vue/no-unregistered-components
禁止使用未在模板内注册的组件
- ⛔ 此规则已在 eslint-plugin-vue v9.0.0 中删除,并由 vue/no-undef-components 规则替换。
📖 规则详情
此规则报告尚未注册且正在模板中使用的组件。
¥This rule reports components that haven't been registered and are being used in the template.
注意
此规则无法检查全局注册的组件和在 mixin 中注册的组件,除非你将它们添加为忽略模式的一部分。默认情况下,component、suspense 和 teleport 被忽略。
¥This rule cannot check globally registered components and components registered in mixins unless you add them as part of the ignored patterns. component, suspense and teleport are ignored by default.
🔧选项
¥🔧 Options
json
{
"vue/no-unregistered-components": ["error", {
"ignorePatterns": []
}]
}ignorePatterns如果组件名称与一个或多个模式匹配,则抑制所有错误。¥
ignorePatternsSuppresses all errors if component name matches one or more patterns.
ignorePatterns: ['custom(\\-\\w+)+']
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v7.0.0 中引入
¥This rule was introduced in eslint-plugin-vue v7.0.0
🔍代码实现
¥🔍 Implementation