Skip to content

Commit d1ff736

Browse files
committed
fix(runtime-vapor): render slot fallback if slot content is not a valid block
close #13668
1 parent 56a7f9d commit d1ff736

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/runtime-vapor/src/componentSlots.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,13 @@ export function createSlot(
126126
const renderSlot = () => {
127127
const slot = getSlot(rawSlots, isFunction(name) ? name() : name)
128128
if (slot) {
129+
fragment.fallback = fallback
129130
// create and cache bound version of the slot to make it stable
130131
// so that we avoid unnecessary updates if it resolves to the same slot
131132
fragment.update(
132133
slot._bound ||
133134
(slot._bound = () => {
134-
const slotContent = slot(slotProps)
135+
let slotContent = slot(slotProps)
135136
if (slotContent instanceof DynamicFragment) {
136137
slotContent.fallback = fallback
137138
}

0 commit comments

Comments
 (0)