fix(runtime-core): do not call transition enter hooks when mounting in suspense (#1588)
fix #1583
This commit is contained in:
parent
64c7b2f9ce
commit
246ec5c594
@ -736,14 +736,17 @@ function baseCreateRenderer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
hostInsert(el, container, anchor)
|
hostInsert(el, container, anchor)
|
||||||
|
// #1583 For inside suspense case, enter hook should call when suspense resolved
|
||||||
|
const needCallTransitionHooks =
|
||||||
|
!parentSuspense && transition && !transition.persisted
|
||||||
if (
|
if (
|
||||||
(vnodeHook = props && props.onVnodeMounted) ||
|
(vnodeHook = props && props.onVnodeMounted) ||
|
||||||
(transition && !transition.persisted) ||
|
needCallTransitionHooks ||
|
||||||
dirs
|
dirs
|
||||||
) {
|
) {
|
||||||
queuePostRenderEffect(() => {
|
queuePostRenderEffect(() => {
|
||||||
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode)
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode)
|
||||||
transition && !transition.persisted && transition.enter(el)
|
needCallTransitionHooks && transition!.enter(el)
|
||||||
dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted')
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted')
|
||||||
}, parentSuspense)
|
}, parentSuspense)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user