From: HcySunYang Date: Fri, 7 May 2021 22:04:36 +0000 (+0800) Subject: fix(Teleport): avoid changing the reference of vnode.dynamicChildren (#3642) X-Git-Tag: v3.1.0-beta.1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43f78151bfdff2103a9be25e66e3f3be68d03a08;p=thirdparty%2Fvuejs%2Fcore.git fix(Teleport): avoid changing the reference of vnode.dynamicChildren (#3642) fix #3641 --- diff --git a/packages/runtime-core/src/components/Teleport.ts b/packages/runtime-core/src/components/Teleport.ts index 5bbe899e4c..764e9a86dc 100644 --- a/packages/runtime-core/src/components/Teleport.ts +++ b/packages/runtime-core/src/components/Teleport.ts @@ -84,13 +84,13 @@ export const TeleportImpl = { } = internals const disabled = isTeleportDisabled(n2.props) - const { shapeFlag, children } = n2 + let { shapeFlag, children, dynamicChildren } = n2 // #3302 // HMR updated, force full diff if (__DEV__ && isHmrUpdating) { optimized = false - n2.dynamicChildren = null + dynamicChildren = null } if (n1 == null) { @@ -146,11 +146,11 @@ export const TeleportImpl = { const currentAnchor = wasDisabled ? mainAnchor : targetAnchor isSVG = isSVG || isTargetSVG(target) - if (n2.dynamicChildren) { + if (dynamicChildren) { // fast path when the teleport happens to be a block root patchBlockChildren( n1.dynamicChildren!, - n2.dynamicChildren, + dynamicChildren, currentContainer, parentComponent, parentSuspense,