fix(ssr): fix dynamic slot regression in ssr

fix #6651
This commit is contained in:
Evan You 2022-09-28 10:24:57 +08:00
parent 9698dd3cf1
commit 8963c5508c
1 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,8 @@ export function createSlots(
const res = slot.fn(...args)
// attach branch key so each conditional branch is considered a
// different fragment
;(res as any).key = slot.key
// #6651 res can be undefined in SSR in string push mode
if (res) (res as any).key = slot.key
return res
}
: slot.fn