From 6daa180de91385f27925d4fbb4771dbd91fa976e Mon Sep 17 00:00:00 2001 From: daiwei Date: Tue, 14 Jan 2025 09:15:51 +0800 Subject: [PATCH] chore: minor tweaks --- packages/runtime-core/src/components/Teleport.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/runtime-core/src/components/Teleport.ts b/packages/runtime-core/src/components/Teleport.ts index b402df37b3..7dab240e3a 100644 --- a/packages/runtime-core/src/components/Teleport.ts +++ b/packages/runtime-core/src/components/Teleport.ts @@ -308,12 +308,6 @@ export const TeleportImpl = { target, props, } = vnode - - if (target) { - hostRemove(targetStart!) - hostRemove(targetAnchor!) - } - // an unmounted teleport should always unmount its children whether it's disabled or not doRemove && hostRemove(anchor!) @@ -321,6 +315,11 @@ export const TeleportImpl = { const disabled = isTeleportDisabled(props) if (!disabled && !target) return + if (target) { + hostRemove(targetStart!) + hostRemove(targetAnchor!) + } + if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) { const shouldRemove = doRemove || !disabled for (let i = 0; i < (children as VNode[]).length; i++) { -- 2.47.2