Skip to content

Commit

Permalink
fix(runtime-core): should still do full traverse of stable fragment c…
Browse files Browse the repository at this point in the history
…hildren in dev + hmr
  • Loading branch information
yyx990803 committed Sep 16, 2020
1 parent bebd44f commit dd40ad8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1155,11 +1155,13 @@ function baseCreateRenderer(
parentSuspense,
isSVG
)
// #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.
// #2134 or if it's a component root, it may also get moved around
// as the component is being moved.
if (
if (__DEV__ && parentComponent && parentComponent.type.__hmrId) {
traverseStaticChildren(n1, n2)
} else if (
// #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.
// #2134 or if it's a component root, it may also get moved around
// as the component is being moved.
n2.key != null ||
(parentComponent && n2 === parentComponent.subTree)
) {
Expand Down

0 comments on commit dd40ad8

Please sign in to comment.