Skip to content

vue/require-slots-as-functions

强制 $slots 的属性用作函数

  • ⚙️ 此规则包含在 "plugin:vue/essential"*.configs["flat/essential"]"plugin:vue/strongly-recommended"*.configs["flat/strongly-recommended"]"plugin:vue/recommended"*.configs["flat/recommended"] 中。

📖 规则详情

此规则强制将 $slots 的属性用作函数。this.$slots.default 在 Vue.js 2.x 中是 VNode 数组,但在 Vue.js 3.x 中更改为返回 VNode 数组的函数。

¥This rule enforces the properties of $slots to be used as a function.
this.$slots.default was an array of VNode in Vue.js 2.x, but changed to a function that returns an array of VNode in Vue.js 3.x.

Now loading...

🔧选项

¥🔧 Options

无。

¥Nothing.

📚扩展阅读

¥📚 Further Reading

🚀版本

¥🚀 Version

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

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

🔍代码实现

¥🔍 Implementation

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