From: daiwei Date: Tue, 14 Jan 2025 01:15:51 +0000 (+0800) Subject: chore: minor tweaks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6daa180de91385f27925d4fbb4771dbd91fa976e;p=thirdparty%2Fvuejs%2Fcore.git chore: minor tweaks --- 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++) {