daiwei hace 11 meses
padre
commit
761b1617a7

+ 4 - 2
packages/runtime-vapor/src/apiCreateFor.ts

@@ -469,8 +469,10 @@ export const createFor = (
   if (!isHydrating && _insertionParent) {
     insert(frag, _insertionParent, _insertionAnchor)
   }
-  if (isHydrating && _insertionAnchor !== undefined) {
-    advanceHydrationNode(_insertionParent!)
+  if (isHydrating) {
+    advanceHydrationNode(
+      _insertionAnchor !== undefined ? _insertionParent! : parentAnchor,
+    )
   }
 
   return frag

+ 2 - 0
packages/runtime-vapor/src/fragment.ts

@@ -145,6 +145,8 @@ export class DynamicFragment extends VaporFragment {
   }
 
   hydrate(label: string, isEmpty: boolean = false): void {
+    if (!label && isEmpty) return
+
     // for `v-if="false"` the node will be an empty comment, use it as the anchor.
     // otherwise, find next sibling vapor fragment anchor
     if (label === 'if' && isEmpty) {