nullcache
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
7 deletions
-
src/components/Form/src/hooks/useFormEvents.ts
-
src/components/Form/src/hooks/useFormValues.ts
|
|
|
@ -432,7 +432,7 @@ function getDefaultValue( |
|
|
|
let defaultValue = cloneDeep(defaultValueRef.value[key]); |
|
|
|
const isInput = checkIsInput(schema); |
|
|
|
if (isInput) { |
|
|
|
return defaultValue || ''; |
|
|
|
return defaultValue || undefined; |
|
|
|
} |
|
|
|
if (!defaultValue && schema && checkIsRangeSlider(schema)) { |
|
|
|
defaultValue = [0, 0]; |
|
|
|
|
|
|
|
@ -76,12 +76,7 @@ export function useFormValues({ |
|
|
|
} |
|
|
|
// Remove spaces
|
|
|
|
if (isString(value)) { |
|
|
|
// remove params from URL
|
|
|
|
if (value === '') { |
|
|
|
value = undefined; |
|
|
|
} else { |
|
|
|
value = value.trim(); |
|
|
|
} |
|
|
|
value = value.trim(); |
|
|
|
} |
|
|
|
if (!tryDeconstructArray(key, value, res) && !tryDeconstructObject(key, value, res)) { |
|
|
|
// 没有解构成功的,按原样赋值
|
|
|
|
|