在 Vue.js 的 eslint 中删除“组件已注册但未使用" [英] Remove 'component has been registered but not used' in eslint for Vue.js

查看:69
本文介绍了在 Vue.js 的 eslint 中删除“组件已注册但未使用"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用动态组件:

然而,eslint 不断返回:

However, eslint keeps returning this:

60:16 错误 组件"组件已注册但未使用
vue/no-unused-components

60:16 error The "component" component has been registered but not used
vue/no-unused-components

如何在 eslint 上禁用上述规则?

How can I disable the rule above on eslint?

推荐答案

您可以通过在 JavaScript 文件的顶部写入以下内容来禁用该特定的 ESLint 规则: /* eslint-disable vue/no-unused-组件 */.请注意,这可能位于单文件组件(即 .vue 文件)中的第一个

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆