export function createSlots(
slots: Record<string, Slot>,
- dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[])[]
+ dynamicSlots: (
+ | CompiledSlotDescriptor
+ | CompiledSlotDescriptor[]
+ | undefined)[]
): Record<string, Slot> {
for (let i = 0; i < dynamicSlots.length; i++) {
const slot = dynamicSlots[i]
for (let j = 0; j < slot.length; j++) {
slots[slot[j].name] = slot[j].fn
}
- } else {
+ } else if (slot) {
// conditional single slot generated by <template v-if="..." #foo>
slots[slot.name] = slot.fn
}