From 91b4280625da8780d48ef9c373ef0905ccb0e4e1 Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 21 Jul 2023 17:40:27 +0800 Subject: [PATCH] fix: vben form bug --- .../src/main/resources/codegen/vue3_vben/views/form.vue.vm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm index 5815a4daa..f0157e2f4 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/form.vue.vm @@ -19,10 +19,10 @@ const { createMessage } = useMessage() const emit = defineEmits(['success', 'register']) const isUpdate = ref(true) -const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({ +const [registerForm, { setFieldsValue, resetFields, resetSchema, validate }] = useForm({ labelWidth: 120, baseColProps: { span: 24 }, - schemas: isUpdate? updateFormSchema : createFormSchema, + schemas: createFormSchema, showActionButtonGroup: false, actionColOptions: { span: 23 } }) @@ -32,6 +32,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data setModalProps({ confirmLoading: false }) isUpdate.value = !!data?.isUpdate if (unref(isUpdate)) { + resetSchema(updateFormSchema) const res = await get${simpleClassName}(data.record.id) setFieldsValue({ ...res }) }