@@ -4,6 +4,7 @@ import { once, isObject, toNumber } from 'shared/util'
4
4
import { inBrowser , isIE9 , warn } from 'core/util/index'
5
5
import { mergeVNodeHook } from 'core/vdom/helpers/index'
6
6
import { activeInstance } from 'core/instance/lifecycle'
7
+
7
8
import {
8
9
nextFrame ,
9
10
resolveTransition ,
@@ -68,16 +69,35 @@ export function enter (vnode: VNodeWithData, toggleDisplay: ?() => void) {
68
69
return
69
70
}
70
71
71
- const startClass = isAppear && appearClass ? appearClass : enterClass
72
- const activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass
73
- const toClass = isAppear && appearToClass ? appearToClass : enterToClass
74
-
75
- const beforeEnterHook = isAppear ? ( beforeAppear || beforeEnter ) : beforeEnter
76
- const enterHook = isAppear ? ( typeof appear === 'function' ? appear : enter ) : enter
77
- const afterEnterHook = isAppear ? ( afterAppear || afterEnter ) : afterEnter
78
- const enterCancelledHook = isAppear ? ( appearCancelled || enterCancelled ) : enterCancelled
72
+ const startClass = isAppear && appearClass
73
+ ? appearClass
74
+ : enterClass
75
+ const activeClass = isAppear && appearActiveClass
76
+ ? appearActiveClass
77
+ : enterActiveClass
78
+ const toClass = isAppear && appearToClass
79
+ ? appearToClass
80
+ : enterToClass
81
+
82
+ const beforeEnterHook = isAppear
83
+ ? ( beforeAppear || beforeEnter )
84
+ : beforeEnter
85
+ const enterHook = isAppear
86
+ ? ( typeof appear === 'function' ? appear : enter )
87
+ : enter
88
+ const afterEnterHook = isAppear
89
+ ? ( afterAppear || afterEnter )
90
+ : afterEnter
91
+ const enterCancelledHook = isAppear
92
+ ? ( appearCancelled || enterCancelled )
93
+ : enterCancelled
94
+
95
+ const explicitEnterDuration : any = toNumber (
96
+ isObject ( duration )
97
+ ? duration . enter
98
+ : duration
99
+ )
79
100
80
- const explicitEnterDuration = toNumber ( isObject ( duration ) ? duration . enter : duration )
81
101
if ( process . env . NODE_ENV !== 'production' && explicitEnterDuration != null ) {
82
102
checkDuration ( explicitEnterDuration , 'enter' , vnode )
83
103
}
@@ -179,7 +199,12 @@ export function leave (vnode: VNodeWithData, rm: Function) {
179
199
const expectsCSS = css !== false && ! isIE9
180
200
const userWantsControl = getHookAgumentsLength ( leave )
181
201
182
- const explicitLeaveDuration = toNumber ( isObject ( duration ) ? duration . leave : duration )
202
+ const explicitLeaveDuration : any = toNumber (
203
+ isObject ( duration )
204
+ ? duration . leave
205
+ : duration
206
+ )
207
+
183
208
if ( process . env . NODE_ENV !== 'production' && explicitLeaveDuration != null ) {
184
209
checkDuration ( explicitLeaveDuration , 'leave' , vnode )
185
210
}
0 commit comments