Skip to content

Commit 0de3dd6

Browse files
authored
fix(input): 修复 复制包含多个'-'的数字到input type=digit 时,格式错误 (#728)
1 parent f0aa112 commit 0de3dd6

File tree

1 file changed

+1
-1
lines changed
  • packages/react-vant/src/components/utils/format

1 file changed

+1
-1
lines changed

packages/react-vant/src/components/utils/format/number.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function formatNumber(
3232
if (allowMinus) {
3333
value = trimExtraChar(value, '-', /-/g)
3434
} else {
35-
value = value.replace(/-/, '')
35+
value = value.replace(/-/g, '')
3636
}
3737

3838
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g

0 commit comments

Comments
 (0)