const instance = getCurrentInstance()!
const state = useTransitionState()
- let prevTransitionKey: any
-
return () => {
const children =
slots.default && getTransitionRawChildren(slots.default(), true)
const oldChild = instance.subTree
const oldInnerChild = oldChild && getKeepAliveChild(oldChild)
- let transitionKeyChanged = false
- const { getTransitionKey } = innerChild.type as any
- if (getTransitionKey) {
- const key = getTransitionKey()
- if (prevTransitionKey === undefined) {
- prevTransitionKey = key
- } else if (key !== prevTransitionKey) {
- prevTransitionKey = key
- transitionKeyChanged = true
- }
- }
-
// handle mode
if (
oldInnerChild &&
oldInnerChild.type !== Comment &&
- (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)
+ !isSameVNodeType(innerChild, oldInnerChild)
) {
const leavingHooks = resolveTransitionHooks(
oldInnerChild,