From 3fa53126ae7fd8f74e12d00af31424609871e232 Mon Sep 17 00:00:00 2001 From: Yang <1196282844@qq.com> Date: Thu, 6 Jun 2024 09:32:30 +0000 Subject: [PATCH] =?UTF-8?q?fix(input):=20=E4=BF=AE=E5=A4=8D=20=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E5=8C=85=E5=90=AB=E5=A4=9A=E4=B8=AA'-'=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E5=88=B0input=20type=3Ddigit=20=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-vant/src/components/utils/format/number.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-vant/src/components/utils/format/number.ts b/packages/react-vant/src/components/utils/format/number.ts index 78e88f778..827a0ddd9 100644 --- a/packages/react-vant/src/components/utils/format/number.ts +++ b/packages/react-vant/src/components/utils/format/number.ts @@ -32,7 +32,7 @@ export function formatNumber( if (allowMinus) { value = trimExtraChar(value, '-', /-/g) } else { - value = value.replace(/-/, '') + value = value.replace(/-/g, '') } const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g