]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): update __vnode of static nodes when patching along the optimized...
authordopamine <coderzyou@gmail.com>
Thu, 1 May 2025 09:54:40 +0000 (17:54 +0800)
committerGitHub <noreply@github.com>
Thu, 1 May 2025 09:54:40 +0000 (02:54 -0700)
* fix(runtime-core):  update __vnode of static nodes when patching along the optimized path

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
packages/runtime-core/src/renderer.ts

index 05c4ac345eb81f9e030bc2078febc24c22f1dfe6..a7f84dac7b41dac4421be1a52d77b48663aab6f4 100644 (file)
@@ -2484,10 +2484,14 @@ export function traverseStaticChildren(
       if (c2.type === Text) {
         c2.el = c1.el
       }
-      // also inherit for comment nodes, but not placeholders (e.g. v-if which
-      // would have received .el during block patch)
-      if (__DEV__ && c2.type === Comment && !c2.el) {
-        c2.el = c1.el
+      if (__DEV__) {
+        // #2324 also inherit for comment nodes, but not placeholders (e.g. v-if which
+        // would have received .el during block patch)
+        if (c2.type === Comment && !c2.el) {
+          c2.el = c1.el
+        }
+
+        c2.el && (c2.el.__vnode = c2)
       }
     }
   }