From: dopamine Date: Thu, 1 May 2025 09:54:40 +0000 (+0800) Subject: fix(runtime-core): update __vnode of static nodes when patching along the optimized... X-Git-Tag: v3.5.14~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3ecee3da8ed5c55dea89ce6b4b376b2b722b018;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-core): update __vnode of static nodes when patching along the optimized path (#13223) * 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> --- diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 05c4ac345e..a7f84dac7b 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) } } }