From: daiwei Date: Mon, 4 Aug 2025 02:48:34 +0000 (+0800) Subject: fix: fix child index X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3fca1f510df53919cf6302352b33700aceca46f1;p=thirdparty%2Fvuejs%2Fcore.git fix: fix child index --- diff --git a/packages/compiler-vapor/src/generators/template.ts b/packages/compiler-vapor/src/generators/template.ts index 664b7c1fb1..b42e2093f9 100644 --- a/packages/compiler-vapor/src/generators/template.ts +++ b/packages/compiler-vapor/src/generators/template.ts @@ -89,7 +89,8 @@ export function genChildren( // child index is used to find the child during hydration. // if offset is not 0, we need to specify the offset to skip the dynamic // children and get the correct child. - const asAnchor = children.some(child => child.anchor === id) + const asAnchor = + id !== undefined && children.some(child => child.anchor === id) let childIndex = offset === 0 ? undefined