Skip to content

Commit

Permalink
fix(transition): should reset enter class after appear (#1152)
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin authored May 11, 2020
1 parent 9d111f5 commit 697de07
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/runtime-dom/src/components/Transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ export function resolveTransitionProps({
return baseProps
}

const originEnterClass = [enterFromClass, enterActiveClass, enterToClass]
const instance = getCurrentInstance()!
const durations = normalizeDuration(duration)
const enterDuration = durations && durations[0]
const leaveDuration = durations && durations[1]
const { appear, onBeforeEnter, onEnter, onLeave } = baseProps

// is appearing
if (appear && !getCurrentInstance()!.isMounted) {
if (appear && !instance.isMounted) {
enterFromClass = appearFromClass
enterActiveClass = appearActiveClass
enterToClass = appearToClass
Expand All @@ -96,6 +97,10 @@ export function resolveTransitionProps({
removeTransitionClass(el, enterToClass)
removeTransitionClass(el, enterActiveClass)
done && done()
// reset enter class
if (appear) {
;[enterFromClass, enterActiveClass, enterToClass] = originEnterClass
}
}

const finishLeave: Hook = (el, done) => {
Expand Down

0 comments on commit 697de07

Please sign in to comment.