|
|
@@ -4,6 +4,7 @@ import { once, isObject, toNumber } from 'shared/util'
|
|
|
import { inBrowser, isIE9, warn } from 'core/util/index'
|
|
|
import { mergeVNodeHook } from 'core/vdom/helpers/index'
|
|
|
import { activeInstance } from 'core/instance/lifecycle'
|
|
|
+
|
|
|
import {
|
|
|
nextFrame,
|
|
|
resolveTransition,
|
|
|
@@ -68,16 +69,35 @@ export function enter (vnode: VNodeWithData, toggleDisplay: ?() => void) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- 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
|
|
|
- const afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter
|
|
|
- const enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled
|
|
|
+ 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
|
|
|
+ const afterEnterHook = isAppear
|
|
|
+ ? (afterAppear || afterEnter)
|
|
|
+ : afterEnter
|
|
|
+ const enterCancelledHook = isAppear
|
|
|
+ ? (appearCancelled || enterCancelled)
|
|
|
+ : enterCancelled
|
|
|
+
|
|
|
+ const explicitEnterDuration: any = toNumber(
|
|
|
+ isObject(duration)
|
|
|
+ ? duration.enter
|
|
|
+ : duration
|
|
|
+ )
|
|
|
|
|
|
- const explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration)
|
|
|
if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {
|
|
|
checkDuration(explicitEnterDuration, 'enter', vnode)
|
|
|
}
|
|
|
@@ -179,7 +199,12 @@ export function leave (vnode: VNodeWithData, rm: Function) {
|
|
|
const expectsCSS = css !== false && !isIE9
|
|
|
const userWantsControl = getHookAgumentsLength(leave)
|
|
|
|
|
|
- const explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration)
|
|
|
+ const explicitLeaveDuration: any = toNumber(
|
|
|
+ isObject(duration)
|
|
|
+ ? duration.leave
|
|
|
+ : duration
|
|
|
+ )
|
|
|
+
|
|
|
if (process.env.NODE_ENV !== 'production' && explicitLeaveDuration != null) {
|
|
|
checkDuration(explicitLeaveDuration, 'leave', vnode)
|
|
|
}
|