Note

This is a documentation for version 7.0.0-beta.2.
To check version 6.2.2 go here. To check previous releases go here.

# vue/require-slots-as-functions

enforce properties of $slots to be used as a function

  • ⚙️ This rule is included in all of "plugin:vue/vue3-essential", "plugin:vue/vue3-strongly-recommended" and "plugin:vue/vue3-recommended".

# 📖 Rule Details

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.

<script> export default { render(h) { /* ✓ GOOD */ var children = this.$slots.default() var children = this.$slots.default && this.$slots.default() /* ✗ BAD */ var children = [...this.$slots.default] var children = this.$slots.default.filter(test) } } </script>
Now loading...

# 🔧 Options

Nothing.

# 📚 Further Reading

# 🔍 Implementation