Skip to content

Commit

Permalink
feat(form): add form field nested support (#591)
Browse files Browse the repository at this point in the history
* feat(form): add form field nested support

* refactor(form): use lodash set replace
  • Loading branch information
hyperq committed May 12, 2021
1 parent 4c16ffa commit ec3d51d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Form/src/hooks/useFormValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]>;
Expand Down Expand Up @@ -40,7 +42,7 @@ export function useFormValues({
if (isString(value)) {
value = value.trim();
}
res[key] = value;
set(res, key, value);
}
return handleRangeTimeValue(res);
}
Expand Down

0 comments on commit ec3d51d

Please sign in to comment.