Browse Source

wip: save

daiwei 11 months ago
parent
commit
80e6ea8730

+ 7 - 7
packages/runtime-vapor/src/dom/hydration.ts

@@ -137,13 +137,13 @@ function locateHydrationNodeImpl(isFragment?: boolean): void {
     }
 
     // locate slot fragment start anchor
-    if (isFragment && node && !isComment(node, '[')) {
-      node = locateVaporFragmentAnchor(node, '[')!
-    } else {
-      while (node && isNonHydrationNode(node)) {
-        node = node.nextSibling!
-      }
-    }
+    // if (isFragment && node && !isComment(node, '[')) {
+    //   node = locateVaporFragmentAnchor(node, '[')!
+    // } else {
+    //   while (node && isNonHydrationNode(node)) {
+    //     node = node.nextSibling!
+    //   }
+    // }
 
     if (insertionParent && node) {
       const nextNode = node.nextSibling

+ 1 - 0
packages/runtime-vapor/src/dom/template.ts

@@ -15,6 +15,7 @@ export function template(html: string, root?: boolean) {
       node = adoptTemplate(currentHydrationNode!, html)!
       // dynamic node position, default is 0
       ;(node as any).$dp = n || 0
+      if (root) (node as any).$root = true
       return node
     }
     // fast path for text nodes