@@ -101,7 +101,8 @@ const TransitionGroupImpl = {
101
101
const cssTransitionProps = resolveTransitionProps ( rawProps )
102
102
const tag = rawProps . tag || Fragment
103
103
prevChildren = children
104
- children = getTransitionRawChildren ( slots . default ? slots . default ( ) : [ ] )
104
+ const slotChildren = slots . default ? slots . default ( ) : [ ]
105
+ children = getTransitionRawChildren ( slotChildren )
105
106
106
107
for ( let i = 0 ; i < children . length ; i ++ ) {
107
108
const child = children [ i ]
@@ -110,7 +111,7 @@ const TransitionGroupImpl = {
110
111
child ,
111
112
resolveTransitionHooks ( child , cssTransitionProps , state , instance )
112
113
)
113
- } else if ( __DEV__ && child . type !== Comment ) {
114
+ } else if ( __DEV__ ) {
114
115
warn ( `<TransitionGroup> children must be keyed.` )
115
116
}
116
117
}
@@ -126,7 +127,7 @@ const TransitionGroupImpl = {
126
127
}
127
128
}
128
129
129
- return createVNode ( tag , null , children )
130
+ return createVNode ( tag , null , slotChildren )
130
131
}
131
132
}
132
133
}
@@ -138,7 +139,9 @@ function getTransitionRawChildren(children: VNode[]): VNode[] {
138
139
// handle fragment children case, e.g. v-for
139
140
if ( child . type === Fragment ) {
140
141
ret = ret . concat ( getTransitionRawChildren ( child . children as VNode [ ] ) )
141
- } else {
142
+ }
143
+ // comment should be skip, e.g. v-if
144
+ if ( child . type !== Comment ) {
142
145
ret . push ( child )
143
146
}
144
147
}
0 commit comments