From bc6f252c4abc72bee29aa4766fc6c5ed0a81d7cd Mon Sep 17 00:00:00 2001 From: underfin <2218301630@qq.com> Date: Fri, 14 Aug 2020 00:36:30 +0800 Subject: [PATCH] fix(runtime-core): should correctly call `beforeEnter` inside `Suspense` (#1805) fix #1795 --- packages/runtime-core/src/renderer.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 6b3b2cfa..8627cb00 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -752,19 +752,17 @@ function baseCreateRenderer( if (treeOwnerId && treeOwnerId !== scopeId) { hostSetScopeId(el, treeOwnerId + '-s') } - - if (transition && !transition.persisted) { - transition.beforeEnter(el) - } } - - hostInsert(el, container, anchor) // #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved // #1689 For inside suspense + suspense resolved case, just call it const needCallTransitionHooks = (!parentSuspense || (parentSuspense && parentSuspense!.isResolved)) && transition && !transition.persisted + if (needCallTransitionHooks) { + transition!.beforeEnter(el) + } + hostInsert(el, container, anchor) if ( (vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks ||