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