]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: cache parent sibling
authordaiwei <daiwei521@126.com>
Mon, 4 Aug 2025 02:11:41 +0000 (10:11 +0800)
committerdaiwei <daiwei521@126.com>
Mon, 4 Aug 2025 02:11:41 +0000 (10:11 +0800)
packages/runtime-vapor/src/dom/hydration.ts

index 855829fddbcf5cadb040b4ce0c8daa8ecd854fe0..b070158d3cd708bfa63818747e3a2a6416ab025f 100644 (file)
@@ -26,9 +26,10 @@ function findParentSibling(n: Node): Node | null {
   return next ? next : findParentSibling(n.parentNode)
 }
 
-export function advanceHydrationNode(node: Node): void {
+export function advanceHydrationNode(node: Node & { $ps?: Node | null }): void {
   // if no next sibling, find the next node in the parent chain
-  const next = node.nextSibling || findParentSibling(node)
+  const next =
+    node.nextSibling || node.$ps || (node.$ps = findParentSibling(node))
   if (next) setCurrentHydrationNode(next)
 }