From e791904e60f04847f8ad2c6a58c0aa1e1c81ff25 Mon Sep 17 00:00:00 2001 From: dopamine Date: Sun, 20 Apr 2025 10:11:35 +0800 Subject: [PATCH 1/2] fix(runtime-core): update __vnode of static nodes when patching along the optimized path --- packages/runtime-core/src/renderer.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 05c4ac345eb..fb767185c6f 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -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) } } } From 9d6a7cb82629b1fc5cd8db2fbaad73441c743d8a Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 20 Apr 2025 02:43:52 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- packages/runtime-core/src/renderer.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index fb767185c6f..a7f84dac7b4 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -2484,13 +2484,13 @@ export function traverseStaticChildren( if (c2.type === Text) { c2.el = c1.el } - if (__DEV__ ) { + 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) { + if (c2.type === Comment && !c2.el) { c2.el = c1.el } - + c2.el && (c2.el.__vnode = c2) } }