Skip to content

Commit

Permalink
fix(hmr): static child traversal should only affect elements
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 11, 2020
1 parent aa1672a commit 2bc6a8c
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 @@ -1984,7 +1984,12 @@ function baseCreateRenderer(
for (let i = 0; i < ch1.length; i++) {
const c1 = ch1[i]
const c2 = ch2[i]
if (isVNode(c1) && isVNode(c2) && !c2.dynamicChildren) {
if (
isVNode(c1) &&
isVNode(c2) &&
c2.shapeFlag & ShapeFlags.ELEMENT &&
!c2.dynamicChildren
) {
if (c2.patchFlag <= 0) {
c2.el = c1.el
}
Expand Down

0 comments on commit 2bc6a8c

Please sign in to comment.