fix(Transition): fix validate duration (#1188)

This commit is contained in:
underfin
2020-05-18 22:09:10 +08:00
committed by GitHub
parent 8e30d0c74c
commit d73a508a73
3 changed files with 17 additions and 11 deletions

View File

@@ -6,7 +6,13 @@ import {
warn
} from '@vue/runtime-core'
import { addEventListener } from '../modules/events'
import { isArray, looseEqual, looseIndexOf, invokeArrayFns } from '@vue/shared'
import {
isArray,
looseEqual,
looseIndexOf,
invokeArrayFns,
toNumber
} from '@vue/shared'
type AssignerFn = (value: any) => void
@@ -33,11 +39,6 @@ function trigger(el: HTMLElement, type: string) {
el.dispatchEvent(e)
}
function toNumber(val: string): number | string {
const n = parseFloat(val)
return isNaN(n) ? val : n
}
type ModelDirective<T> = ObjectDirective<T & { _assign: AssignerFn }>
// We are exporting the v-model runtime directly as vnode hooks so that it can