fix(v-model): fix case where .trim and .number modifiers are used together (#5842)

fix #5839
This commit is contained in:
小刘(liulinboyi)
2022-05-13 07:52:16 +08:00
committed by GitHub
parent a3881299e9
commit 71066b5afe
4 changed files with 60 additions and 3 deletions

View File

@@ -52,7 +52,8 @@ export const vModelText: ModelDirective<
let domValue: string | number = el.value
if (trim) {
domValue = domValue.trim()
} else if (castToNumber) {
}
if (castToNumber) {
domValue = toNumber(domValue)
}
el._assign(domValue)