From: underfin <2218301630@qq.com> Date: Tue, 28 Jul 2020 19:52:20 +0000 (+0800) Subject: fix(hmr): should update el for `HYDRATE_EVENTS` patchFlags node (#1707) X-Git-Tag: v3.0.0-rc.5~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de62cc040c22e3bd93222a9cc84b6564a4b08b51;p=thirdparty%2Fvuejs%2Fcore.git fix(hmr): should update el for `HYDRATE_EVENTS` patchFlags node (#1707) fix https://github.com/vitejs/vite/issues/613 --- diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index df26f87ac7..ed83225318 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -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)