From a1b9bbc2ce61ee27bf7a0fe3d244a8d641867ca1 Mon Sep 17 00:00:00 2001 From: ZhangZhiChao <54631354+Alkaidcc@users.noreply.github.com> Date: Sun, 19 Feb 2023 14:25:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E7=BD=AE=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=97=B6=E7=A7=BB=E9=99=A4URL=E4=B8=AD=E7=9A=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20(#2559)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/hooks/useFormValues.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Form/src/hooks/useFormValues.ts b/src/components/Form/src/hooks/useFormValues.ts index a4865993414..650d17d7f9d 100644 --- a/src/components/Form/src/hooks/useFormValues.ts +++ b/src/components/Form/src/hooks/useFormValues.ts @@ -76,7 +76,12 @@ export function useFormValues({ } // Remove spaces if (isString(value)) { - value = value.trim(); + // remove params from URL + if(value === '') { + value = undefined; + }else { + value = value.trim(); + } } if (!tryDeconstructArray(key, value, res) && !tryDeconstructObject(key, value, res)) { // 没有解构成功的,按原样赋值