Skip to content

Commit

Permalink
fix: handle async placeholders in normalizeScopedSlot (#11963)
Browse files Browse the repository at this point in the history
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
  • Loading branch information
pi0 and posva authored Apr 16, 2021
1 parent 0603ff6 commit af54514
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/vdom/helpers/normalize-scoped-slots.js
Original file line number Diff line number Diff line change
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]
return res && (
res.length === 0 ||
(res.length === 1 && res[0].isComment) // #9658
!vnode ||
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
) ? undefined
: res
}
Expand Down

0 comments on commit af54514

Please sign in to comment.