Browse Source

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

pull/2562/head
ZhangZhiChao 4 years ago
committed by GitHub
parent
commit
a1b9bbc2ce
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/components/Form/src/hooks/useFormValues.ts

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

Loading…
Cancel
Save