Skip to content

Commit

Permalink
fix: 重置表单时移除URL中的参数 (#2559)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkaidcc authored Feb 19, 2023
1 parent 64d6fec commit a1b9bbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Form/src/hooks/useFormValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
// 没有解构成功的,按原样赋值
Expand Down

0 comments on commit a1b9bbc

Please sign in to comment.