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: handle async placeholders in normalizeScopedSlot #11963

Merged
merged 3 commits into from Apr 16, 2021
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions src/core/vdom/helpers/normalize-scoped-slots.js
Expand Up @@ -3,6 +3,7 @@
import { def } from 'core/util/lang'
import { normalizeChildren } from 'core/vdom/helpers/normalize-children'
import { emptyObject } from 'shared/util'
import { isAsyncPlaceholder } from './is-async-placeholder'

export function normalizeScopedSlots (
slots: { [key: string]: Function } | void,
Expand Down Expand Up @@ -60,9 +61,10 @@ function normalizeScopedSlot(normalSlots, key, fn) {
res = res && typeof res === 'object' && !Array.isArray(res)
? [res] // single vnode
: normalizeChildren(res)
let vnode: VNode = res && res[0]
pi0 marked this conversation as resolved.
Show resolved Hide resolved
return res && (
res.length === 0 ||
(res.length === 1 && res[0].isComment) // #9658
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
}
Expand Down