]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: mark single root for transition block
authordaiwei <daiwei521@126.com>
Thu, 19 Jun 2025 06:41:06 +0000 (14:41 +0800)
committerdaiwei <daiwei521@126.com>
Thu, 19 Jun 2025 06:58:51 +0000 (14:58 +0800)
packages/runtime-vapor/src/components/Transition.ts
packages/runtime-vapor/src/components/TransitionGroup.ts

index 39e34277edc2f3b1233b17206641d4de4a5f1d65..017cb0fd5c880d37523a1657bfc84ec6293c1409 100644 (file)
@@ -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)
   }
 
index 9f239f7080ea5eb21c3957b43b36c90fc8b0c8b8..2eff0e91dad913ed87d5668dccc63af067d42bd8 100644 (file)
@@ -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