Vue · Senior · Question 37 of 75
What does defineSlots add?
defineSlots<{
default(props: { item: User }): any;
empty(): any;
}>();- ✓Correct answer: Type checking for slot names and scoped slot props in the parent's template
- 2Runtime validation that slots are provided
- 3The ability to render slots on the server
Explanation
Without it, slot props are any in the parent. It is type-only and compiled away.