fix(runtime-core): use correct container for moving Teleport content (#1703)

This commit is contained in:
underfin
2020-07-28 23:23:39 +08:00
committed by GitHub
parent fbf865d9d4
commit 04a4ebaaeb
3 changed files with 57 additions and 2 deletions

View File

@@ -139,6 +139,13 @@ export const TeleportImpl = {
parentSuspense,
isSVG
)
if (n2.patchFlag > 0 && n2.shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
const oldChildren = n1.children as VNode[]
const children = n2.children as VNode[]
for (let i = 0; i < children.length; i++) {
children[i].el = oldChildren[i].el
}
}
} else if (!optimized) {
patchChildren(
n1,