daiwei 11 ماه پیش
والد
کامیت
80e6ea8730
2فایلهای تغییر یافته به همراه8 افزوده شده و 7 حذف شده
  1. 7 7
      packages/runtime-vapor/src/dom/hydration.ts
  2. 1 0
      packages/runtime-vapor/src/dom/template.ts

+ 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