From 0de3dd6494091afbab397e72092104ce83d2cb5a Mon Sep 17 00:00:00 2001 From: Yang <1196282844@qq.com> Date: Fri, 7 Jun 2024 10:15:40 +0800 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=20(#728)?= 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