]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: fix child index
authordaiwei <daiwei521@126.com>
Mon, 4 Aug 2025 02:48:34 +0000 (10:48 +0800)
committerdaiwei <daiwei521@126.com>
Mon, 4 Aug 2025 02:48:34 +0000 (10:48 +0800)
packages/compiler-vapor/src/generators/template.ts

index 664b7c1fb10137996317412424c4be719da404df..b42e2093f9c998b13407a67a1567f9f883b27547 100644 (file)
@@ -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