@@ -26,7 +26,7 @@ import {
2626 applyFallthroughProps ,
2727 isVaporComponent ,
2828} from '../component'
29- import { extend , isArray } from '@vue/shared'
29+ import { isArray } from '@vue/shared'
3030import { renderEffect } from '../renderEffect'
3131import { isFragment } from '../fragment'
3232import {
@@ -85,15 +85,15 @@ export const VaporTransition: FunctionalVaporComponent = /*@__PURE__*/ decorate(
8585 renderEffect ( ( ) => {
8686 resolvedProps = resolveTransitionProps ( props )
8787 if ( isMounted ) {
88- // only update props for Fragment block , for later reusing
88+ // only update props for Fragment transition , for later reusing
8989 if ( isFragment ( children ) ) {
9090 children . $transition ! . props = resolvedProps
9191 } else {
9292 const child = findTransitionBlock ( children )
9393 if ( child ) {
9494 // replace existing transition hooks
9595 child . $transition ! . props = resolvedProps
96- applyTransitionHooks ( child , child . $transition ! , undefined , true )
96+ applyTransitionHooks ( child , child . $transition ! , true )
9797 }
9898 }
9999 } else {
@@ -102,33 +102,19 @@ export const VaporTransition: FunctionalVaporComponent = /*@__PURE__*/ decorate(
102102 } )
103103
104104 // fallthrough attrs
105- let fallthroughAttrs = true
106- if ( instance . hasFallthrough ) {
107- renderEffect ( ( ) => {
108- // attrs are accessed in advance
109- const resolvedAttrs = extend ( { } , attrs )
110- const child = findTransitionBlock ( children )
111- if ( child ) {
112- // mark single root
113- ; ( child as any ) . $root = true
114-
115- applyFallthroughProps ( child , resolvedAttrs )
116- // ensure fallthrough attrs are not happened again in
117- // applyTransitionHooks
118- fallthroughAttrs = false
119- }
120- } )
105+ if (
106+ instance . hasFallthrough &&
107+ Object . keys ( attrs ) . length &&
108+ children instanceof Element
109+ ) {
110+ renderEffect ( ( ) => applyFallthroughProps ( children , attrs ) )
121111 }
122112
123- const hooks = applyTransitionHooks (
124- children ,
125- {
126- state : useTransitionState ( ) ,
127- props : resolvedProps ! ,
128- instance : instance ,
129- } as VaporTransitionHooks ,
130- fallthroughAttrs ,
131- )
113+ const hooks = applyTransitionHooks ( children , {
114+ state : useTransitionState ( ) ,
115+ props : resolvedProps ! ,
116+ instance : instance ,
117+ } as VaporTransitionHooks )
132118
133119 if ( resetDisplay && resolvedProps ! . appear ) {
134120 const child = findTransitionBlock ( children ) !
@@ -210,7 +196,6 @@ export function resolveTransitionHooks(
210196export function applyTransitionHooks (
211197 block : Block ,
212198 hooks : VaporTransitionHooks ,
213- fallthroughAttrs : boolean = true ,
214199 isResolved : boolean = false ,
215200) : VaporTransitionHooks {
216201 // filter out comment nodes
@@ -246,13 +231,6 @@ export function applyTransitionHooks(
246231 child . $transition = resolvedHooks
247232 if ( isFrag ) setTransitionHooksOnFragment ( block , resolvedHooks )
248233
249- // fallthrough attrs
250- if ( fallthroughAttrs && instance . hasFallthrough ) {
251- // mark single root
252- ; ( child as any ) . $root = true
253- applyFallthroughProps ( child , instance . attrs )
254- }
255-
256234 return resolvedHooks
257235}
258236
0 commit comments