File tree 1 file changed +15
-6
lines changed
packages/runtime-dom/src/components
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,7 @@ const TransitionGroupImpl = {
101
101
const cssTransitionProps = resolveTransitionProps ( rawProps )
102
102
const tag = rawProps . tag || Fragment
103
103
prevChildren = children
104
- children = slots . default ? slots . default ( ) : [ ]
105
-
106
- // handle fragment children case, e.g. v-for
107
- if ( children . length === 1 && children [ 0 ] . type === Fragment ) {
108
- children = children [ 0 ] . children as VNode [ ]
109
- }
104
+ children = getTransitionRawChildren ( slots . default ? slots . default ( ) : [ ] )
110
105
111
106
for ( let i = 0 ; i < children . length ; i ++ ) {
112
107
const child = children [ i ]
@@ -136,6 +131,20 @@ const TransitionGroupImpl = {
136
131
}
137
132
}
138
133
134
+ function getTransitionRawChildren ( children : VNode [ ] ) : VNode [ ] {
135
+ let ret : VNode [ ] = [ ]
136
+ for ( let i = 0 ; i < children . length ; i ++ ) {
137
+ const child = children [ i ]
138
+ // handle fragment children case, e.g. v-for
139
+ if ( child . type === Fragment ) {
140
+ ret = ret . concat ( getTransitionRawChildren ( child . children as VNode [ ] ) )
141
+ } else {
142
+ ret . push ( child )
143
+ }
144
+ }
145
+ return ret
146
+ }
147
+
139
148
// remove mode props as TransitionGroup doesn't support it
140
149
delete TransitionGroupImpl . props . mode
141
150
You can’t perform that action at this time.
0 commit comments