Skip to content

Commit

Permalink
fix(runtime-core): ensure root stable fragments inherit elements for …
Browse files Browse the repository at this point in the history
…moving

fix #2134
  • Loading branch information
yyx990803 committed Sep 16, 2020
1 parent c7b4a37 commit bebd44f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,12 @@ function baseCreateRenderer(
)
// #2080 if the stable fragment has a key, it's a <template v-for> that may
// get moved around. Make sure all root level vnodes inherit el.
if (n2.key != null) {
// #2134 or if it's a component root, it may also get moved around
// as the component is being moved.
if (
n2.key != null ||
(parentComponent && n2 === parentComponent.subTree)
) {
traverseStaticChildren(n1, n2, true /* shallow */)
}
} else {
Expand Down

0 comments on commit bebd44f

Please sign in to comment.