feat(form): add form field nested support (#591)

* feat(form): add form field nested support

* refactor(form): use lodash set replace
This commit is contained in:
HUCHAOQI 2021-05-12 20:35:28 +08:00 committed by GitHub
parent 4c16ffa383
commit ec3d51d69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,8 @@ import { unref } from 'vue';
import type { Ref, ComputedRef } from 'vue';
import type { FormProps, FormSchema } from '../types/form';
import { set } from 'lodash-es';
interface UseFormValuesContext {
defaultValueRef: Ref<any>;
getSchema: ComputedRef<FormSchema[]>;
@ -40,7 +42,7 @@ export function useFormValues({
if (isString(value)) {
value = value.trim();
}
res[key] = value;
set(res, key, value);
}
return handleRangeTimeValue(res);
}