Skip to content

Commit

Permalink
fix transition appear class fallback (fix #4985)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 24, 2017
1 parent d304eee commit 7d3309d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/platforms/web/runtime/modules/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export function enter (vnode: VNodeWithData, toggleDisplay: ?() => void) {
return
}

const startClass = isAppear ? appearClass : enterClass
const activeClass = isAppear ? appearActiveClass : enterActiveClass
const toClass = isAppear ? appearToClass : enterToClass
const startClass = isAppear && appearClass ? appearClass : enterClass
const activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass
const toClass = isAppear && appearToClass ? appearToClass : enterToClass

const beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter
const enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter
Expand Down
9 changes: 3 additions & 6 deletions src/platforms/web/runtime/transition-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ export function resolveTransition (def?: string | Object): ?Object {
const autoCssTransition: (name: string) => Object = cached(name => {
return {
enterClass: `${name}-enter`,
leaveClass: `${name}-leave`,
appearClass: `${name}-enter`,
enterToClass: `${name}-enter-to`,
leaveToClass: `${name}-leave-to`,
appearToClass: `${name}-enter-to`,
enterActiveClass: `${name}-enter-active`,
leaveActiveClass: `${name}-leave-active`,
appearActiveClass: `${name}-enter-active`
leaveClass: `${name}-leave`,
leaveToClass: `${name}-leave-to`,
leaveActiveClass: `${name}-leave-active`
}
})

Expand Down

0 comments on commit 7d3309d

Please sign in to comment.