fix: 重置表单时移除URL中的参数 (#2559)

This commit is contained in:
ZhangZhiChao 2023-02-19 14:25:09 +08:00 committed by GitHub
parent 64d6fece08
commit a1b9bbc2ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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)) {
// 没有解构成功的,按原样赋值