]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(hmr): should update el for `HYDRATE_EVENTS` patchFlags node (#1707)
authorunderfin <2218301630@qq.com>
Tue, 28 Jul 2020 19:52:20 +0000 (03:52 +0800)
committerGitHub <noreply@github.com>
Tue, 28 Jul 2020 19:52:20 +0000 (15:52 -0400)
fix https://github.com/vitejs/vite/issues/613

packages/runtime-core/src/renderer.ts

index df26f87ac7174ecb95e5157bdfbee126d19235b9..ed832253182e1de89d876932860b6941418f9196 100644 (file)
@@ -2105,7 +2105,7 @@ function baseCreateRenderer(
         const c1 = ch1[i] as VNode
         const c2 = (ch2[i] = cloneIfMounted(ch2[i] as VNode))
         if (c2.shapeFlag & ShapeFlags.ELEMENT && !c2.dynamicChildren) {
-          if (c2.patchFlag <= 0) {
+          if (c2.patchFlag <= 0 || c2.patchFlag === PatchFlags.HYDRATE_EVENTS) {
             c2.el = c1.el
           }
           traverseStaticChildren(c1, c2)