const cssTransitionProps = resolveTransitionProps(rawProps)
const tag = rawProps.tag || Fragment
prevChildren = children
- children = getTransitionRawChildren(slots.default ? slots.default() : [])
+ const slotChildren = slots.default ? slots.default() : []
+ children = getTransitionRawChildren(slotChildren)
for (let i = 0; i < children.length; i++) {
const child = children[i]
child,
resolveTransitionHooks(child, cssTransitionProps, state, instance)
)
- } else if (__DEV__ && child.type !== Comment) {
+ } else if (__DEV__) {
warn(`<TransitionGroup> children must be keyed.`)
}
}
}
}
- return createVNode(tag, null, children)
+ return createVNode(tag, null, slotChildren)
}
}
}
// handle fragment children case, e.g. v-for
if (child.type === Fragment) {
ret = ret.concat(getTransitionRawChildren(child.children as VNode[]))
- } else {
+ }
+ // comment should be skip, e.g. v-if
+ if (child.type !== Comment) {
ret.push(child)
}
}