|
1 | 1 | /* @flow */
|
2 | 2 |
|
3 |
| -import { once, isObject } from 'shared/util' |
| 3 | +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'
|
@@ -77,7 +77,7 @@ export function enter (vnode: VNodeWithData, toggleDisplay: ?() => void) {
|
77 | 77 | const afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter
|
78 | 78 | const enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled
|
79 | 79 |
|
80 |
| - const explicitEnterDuration = isObject(duration) ? duration.enter : duration |
| 80 | + const explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration) |
81 | 81 | if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {
|
82 | 82 | checkDuration(explicitEnterDuration, 'enter', vnode)
|
83 | 83 | }
|
@@ -179,7 +179,7 @@ export function leave (vnode: VNodeWithData, rm: Function) {
|
179 | 179 | const expectsCSS = css !== false && !isIE9
|
180 | 180 | const userWantsControl = getHookAgumentsLength(leave)
|
181 | 181 |
|
182 |
| - const explicitLeaveDuration = isObject(duration) ? duration.leave : duration |
| 182 | + const explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration) |
183 | 183 | if (process.env.NODE_ENV !== 'production' && explicitLeaveDuration != null) {
|
184 | 184 | checkDuration(explicitLeaveDuration, 'leave', vnode)
|
185 | 185 | }
|
|
0 commit comments