Skip to content

Commit

Permalink
fix(runtime-core): should correctly call beforeEnter inside `Suspen…
Browse files Browse the repository at this point in the history
…se` (#1805)

fix #1795
  • Loading branch information
underfin committed Aug 13, 2020
1 parent 3991ff0 commit bc6f252
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/runtime-core/src/renderer.ts
Expand Up @@ -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 ||
Expand Down

0 comments on commit bc6f252

Please sign in to comment.