fix(teleport): only inherit el for non-patched nodes

fix #1903
This commit is contained in:
Evan You
2020-08-20 10:43:57 -04:00
parent 69cfed6b31
commit d4cc7b2496
2 changed files with 8 additions and 5 deletions

View File

@@ -146,7 +146,10 @@ export const TeleportImpl = {
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
// only inherit for non-patched nodes (i.e. static ones)
if (!children[i].el) {
children[i].el = oldChildren[i].el
}
}
}
} else if (!optimized) {