Skip to content

vue/no-deprecated-slot-attribute

禁止弃用的 slot 属性(在 Vue.js 2.6.0+ 中)

  • ⚙️ 此规则包含在 "plugin:vue/essential"*.configs["flat/essential"]"plugin:vue/strongly-recommended"*.configs["flat/strongly-recommended"]"plugin:vue/recommended"*.configs["flat/recommended"] 中。
  • 🔧命令行 上的 --fix 选项可以自动修复此规则报告的一些问题。

    ¥🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 规则详情

此规则报告 Vue.js v2.6.0+ 中已弃用的 slot 属性。

¥This rule reports deprecated slot attribute in Vue.js v2.6.0+.

Now loading...

🔧选项

¥🔧 Options

json
{
  "vue/no-deprecated-slot-attribute": ["error", {
    "ignore": ["my-component"],
    "ignoreParents": ["my-web-component"],
  }]
}
  • "ignore" (string[]) 忽略这些规则的标签或正则表达式模式数组(例如 /^custom-/)。此选项将检查给定标签名称的 kebab-case 和 PascalCase 版本。默认值为空。

    ¥"ignore" (string[]) An array of tags or regular expression patterns (e.g. /^custom-/) that ignore these rules. This option will check both kebab-case and PascalCase versions of the given tag names. Default is empty.

  • "ignoreParents" (string[]) 忽略这些规则的父级标签或正则表达式模式数组(例如 /^custom-/)。此选项对 Web 组件 特别有用。默认值为空。

    ¥"ignoreParents" (string[]) An array of tags or regular expression patterns (e.g. /^custom-/) for parents that ignore these rules. This option is especially useful for Web-Components. Default is empty.

"ignore": ["my-component"]

Now loading...

"ignoreParents": ["my-web-component"]

Now loading...

📚扩展阅读

¥📚 Further Reading

🚀版本

¥🚀 Version

此规则在 eslint-plugin-vue v6.1.0 中引入

¥This rule was introduced in eslint-plugin-vue v6.1.0

🔍代码实现

¥🔍 Implementation

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