Skip to content

Commit

Permalink
Merge pull request #219 from suyuan32/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
suyuan32 committed Jun 8, 2024
2 parents 8c20788 + d0d5c74 commit fdb7c13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/components/Form/src/hooks/useFormEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ export function useFormEvents({
});
_setDefaultValue(updatedSchema);

schemaRef.value = uniqueBy(schema, (obj) => {
obj.field;
});
schemaRef.value = uniqueBy(schema, (obj) => obj.field);
}

function _setDefaultValue(data: FormSchema | FormSchema[]) {
Expand Down
5 changes: 3 additions & 2 deletions src/views/sys/user/UserDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
const { t } = useI18n();
const { createMessage } = useMessage();
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
labelWidth: 160,
baseColProps: { span: 24 },
layout: 'vertical',
Expand All @@ -41,12 +41,13 @@
setDrawerProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
setFieldsValue({
...data.record,
});
}
updateSchema({ field: 'password', required: !unref(isUpdate) });
});
const getTitle = computed(() =>
Expand Down

0 comments on commit fdb7c13

Please sign in to comment.