parent
a0c577692f
commit
dddbd96dfe
@ -174,9 +174,11 @@ export function resolveTransitionProps(
|
|||||||
done && done()
|
done && done()
|
||||||
}
|
}
|
||||||
|
|
||||||
let isLeaving = false
|
const finishLeave = (
|
||||||
const finishLeave = (el: Element, done?: () => void) => {
|
el: Element & { _isLeaving?: boolean },
|
||||||
isLeaving = false
|
done?: () => void
|
||||||
|
) => {
|
||||||
|
el._isLeaving = false
|
||||||
removeTransitionClass(el, leaveFromClass)
|
removeTransitionClass(el, leaveFromClass)
|
||||||
removeTransitionClass(el, leaveToClass)
|
removeTransitionClass(el, leaveToClass)
|
||||||
removeTransitionClass(el, leaveActiveClass)
|
removeTransitionClass(el, leaveActiveClass)
|
||||||
@ -223,8 +225,8 @@ export function resolveTransitionProps(
|
|||||||
},
|
},
|
||||||
onEnter: makeEnterHook(false),
|
onEnter: makeEnterHook(false),
|
||||||
onAppear: makeEnterHook(true),
|
onAppear: makeEnterHook(true),
|
||||||
onLeave(el, done) {
|
onLeave(el: Element & { _isLeaving?: boolean }, done) {
|
||||||
isLeaving = true
|
el._isLeaving = true
|
||||||
const resolve = () => finishLeave(el, done)
|
const resolve = () => finishLeave(el, done)
|
||||||
addTransitionClass(el, leaveFromClass)
|
addTransitionClass(el, leaveFromClass)
|
||||||
if (__COMPAT__ && legacyClassEnabled) {
|
if (__COMPAT__ && legacyClassEnabled) {
|
||||||
@ -234,7 +236,7 @@ export function resolveTransitionProps(
|
|||||||
forceReflow()
|
forceReflow()
|
||||||
addTransitionClass(el, leaveActiveClass)
|
addTransitionClass(el, leaveActiveClass)
|
||||||
nextFrame(() => {
|
nextFrame(() => {
|
||||||
if (!isLeaving) {
|
if (!el._isLeaving) {
|
||||||
// cancelled
|
// cancelled
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user