fix(runtime-core): avoid unmount teleport's children multiple times (#3499)
fix #3497
This commit is contained in:
@@ -2096,7 +2096,16 @@ function baseCreateRenderer(
|
||||
invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount')
|
||||
}
|
||||
|
||||
if (
|
||||
if (shapeFlag & ShapeFlags.TELEPORT) {
|
||||
;(vnode.type as typeof TeleportImpl).remove(
|
||||
vnode,
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
optimized,
|
||||
internals,
|
||||
doRemove
|
||||
)
|
||||
} else if (
|
||||
dynamicChildren &&
|
||||
// #1153: fast path should not be taken for non-stable (v-for) fragments
|
||||
(type !== Fragment ||
|
||||
@@ -2119,17 +2128,6 @@ function baseCreateRenderer(
|
||||
unmountChildren(children as VNode[], parentComponent, parentSuspense)
|
||||
}
|
||||
|
||||
if (shapeFlag & ShapeFlags.TELEPORT) {
|
||||
;(vnode.type as typeof TeleportImpl).remove(
|
||||
vnode,
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
optimized,
|
||||
internals,
|
||||
doRemove
|
||||
)
|
||||
}
|
||||
|
||||
if (doRemove) {
|
||||
remove(vnode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user