Skip to content

Commit af54514

Browse files
pi0posva
andauthoredApr 16, 2021
fix: handle async placeholders in normalizeScopedSlot (#11963)
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
1 parent 0603ff6 commit af54514

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/core/vdom/helpers/normalize-scoped-slots.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { def } from 'core/util/lang'
44
import { normalizeChildren } from 'core/vdom/helpers/normalize-children'
55
import { emptyObject } from 'shared/util'
6+
import { isAsyncPlaceholder } from './is-async-placeholder'
67

78
export function normalizeScopedSlots (
89
slots: { [key: string]: Function } | void,
@@ -60,9 +61,10 @@ function normalizeScopedSlot(normalSlots, key, fn) {
6061
res = res && typeof res === 'object' && !Array.isArray(res)
6162
? [res] // single vnode
6263
: normalizeChildren(res)
64+
let vnode: VNode = res && res[0]
6365
return res && (
64-
res.length === 0 ||
65-
(res.length === 1 && res[0].isComment) // #9658
66+
!vnode ||
67+
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
6668
) ? undefined
6769
: res
6870
}

0 commit comments

Comments
 (0)
Please sign in to comment.