Skip to content

vue/no-unregistered-components

禁止使用未在模板内注册的组件

📖 规则详情

此规则报告尚未注册且正在模板中使用的组件。

¥This rule reports components that haven't been registered and are being used in the template.

注意

此规则无法检查全局注册的组件和在 mixin 中注册的组件,除非你将它们添加为忽略模式的一部分。默认情况下,componentsuspenseteleport 被忽略。

¥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.

Now loading...
Now loading...

🔧选项

¥🔧 Options

json
{
  "vue/no-unregistered-components": ["error", {
    "ignorePatterns": []
  }]
}
  • ignorePatterns 如果组件名称与一个或多个模式匹配,则抑制所有错误。

    ¥ignorePatterns Suppresses all errors if component name matches one or more patterns.

ignorePatterns: ['custom(\\-\\w+)+']

Now loading...
Now loading...

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v7.0.0 中引入

¥This rule was introduced in eslint-plugin-vue v7.0.0

🔍代码实现

¥🔍 Implementation

eslint-plugin-vue v10.4 中文网 - 粤ICP备13048890号