From af54514cf97e724d224408c1ecc6c81ddccd4b75 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Fri, 16 Apr 2021 17:33:56 +0200 Subject: [PATCH] fix: handle async placeholders in normalizeScopedSlot (#11963) Co-authored-by: Eduardo San Martin Morote --- src/core/vdom/helpers/normalize-scoped-slots.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/vdom/helpers/normalize-scoped-slots.js b/src/core/vdom/helpers/normalize-scoped-slots.js index 1e43fd39..15ab396d 100644 --- a/src/core/vdom/helpers/normalize-scoped-slots.js +++ b/src/core/vdom/helpers/normalize-scoped-slots.js @@ -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, @@ -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 }