Bläddra i källkod

fix: mark single root for transition block

daiwei 1 år sedan
förälder
incheckning
542e4012c1

+ 5 - 0
packages/runtime-vapor/src/components/Transition.ts

@@ -74,6 +74,9 @@ export const VaporTransition: FunctionalVaporComponent = /*@__PURE__*/ decorate(
         const resolvedAttrs = extend({}, attrs)
         const child = findTransitionBlock(children)
         if (child) {
+          // mark single root
+          ;(child as any).$root = true
+
           applyFallthroughProps(child, resolvedAttrs)
           // ensure fallthrough attrs are not happened again in
           // applyTransitionHooks
@@ -189,6 +192,8 @@ export function applyTransitionHooks(
 
   // fallthrough attrs
   if (fallthroughAttrs && instance.hasFallthrough) {
+    // mark single root
+    ;(child as any).$root = true
     applyFallthroughProps(child, instance.attrs)
   }
 

+ 1 - 0
packages/runtime-vapor/src/components/TransitionGroup.ts

@@ -153,6 +153,7 @@ export const VaporTransitionGroup: ObjectVaporComponent = decorate({
       insert(slottedBlock, container)
       // fallthrough attrs
       if (instance!.hasFallthrough) {
+        ;(container as any).$root = true
         renderEffect(() => applyFallthroughProps(container, instance!.attrs))
       }
       return container