Appearance
vue/require-explicit-slots
要求明确定义插槽
¥require slots to be explicitly defined
📖 规则详情
此规则强制模板中使用的所有 slot 必须在 script setup
块中使用 defineSlots
宏定义一次,或者在 Options API 中使用 slots property
定义一次。
¥This rule enforces all slots used in the template to be defined once either in the script setup
block with the defineSlots
macro, or with the slots property
in the Options API.
🔧选项
¥🔧 Options
无。
¥Nothing.
🚀版本
¥🚀 Version
此规则是在 eslint-plugin-vue v9.21.0 中引入的
¥This rule was introduced in eslint-plugin-vue v9.21.0
🔍代码实现
¥🔍 Implementation