fix(hmr): should update el for HYDRATE_EVENTS patchFlags node (#1707)

fix https://github.com/vitejs/vite/issues/613
This commit is contained in:
underfin 2020-07-29 03:52:20 +08:00 committed by GitHub
parent 421a70de5e
commit de62cc040c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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)