]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): handle patch flag de-op from cloned vnode
authorEvan You <yyx990803@gmail.com>
Fri, 26 Jun 2020 22:05:53 +0000 (18:05 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 26 Jun 2020 22:05:53 +0000 (18:05 -0400)
close #1426

packages/runtime-core/src/renderer.ts

index edc00d1750d448b5b49e213c4f6aca4e8d308c7c..4dfc2ab6630a52d652be43701a044e468410d3ab 100644 (file)
@@ -780,7 +780,10 @@ function baseCreateRenderer(
   ) => {
     const el = (n2.el = n1.el!)
     let { patchFlag, dynamicChildren, dirs } = n2
-    const oldProps = (n1 && n1.props) || EMPTY_OBJ
+    // #1426 take the old vnode's patch flag into account since user may clone a
+    // compiler-generated vnode, which de-opts to FULL_PROPS
+    patchFlag |= n1.patchFlag & PatchFlags.FULL_PROPS
+    const oldProps = n1.props || EMPTY_OBJ
     const newProps = n2.props || EMPTY_OBJ
     let vnodeHook: VNodeHook | undefined | null