fix(hmr): static child traversal should only affect elements

This commit is contained in:
Evan You 2020-05-11 15:46:30 -04:00
parent aa1672a8bd
commit 2bc6a8c1cf

View File

@ -1984,7 +1984,12 @@ function baseCreateRenderer(
for (let i = 0; i < ch1.length; i++) { for (let i = 0; i < ch1.length; i++) {
const c1 = ch1[i] const c1 = ch1[i]
const c2 = ch2[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) { if (c2.patchFlag <= 0) {
c2.el = c1.el c2.el = c1.el
} }