Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(slots): check nullability for multi-branch dynamic slots #6660

Merged
merged 3 commits into from Sep 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/runtime-core/src/helpers/createSlots.ts
Expand Up @@ -31,9 +31,11 @@ export function createSlots(
slots[slot.name] = slot.key
? (...args: any[]) => {
const res = slot.fn(...args)
// attach branch key so each conditional branch is considered a
// different fragment
;(res as any).key = slot.key
if (res) {
// attach branch key so each conditional branch is considered a
// different fragment
;(res as any).key = slot.key
}
return res
}
: slot.fn
Expand Down