From 3fca1f510df53919cf6302352b33700aceca46f1 Mon Sep 17 00:00:00 2001 From: daiwei Date: Mon, 4 Aug 2025 10:48:34 +0800 Subject: [PATCH] fix: fix child index --- packages/compiler-vapor/src/generators/template.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.47.3