From d42acb477c577c0f855403bff371e0780e630cdc Mon Sep 17 00:00:00 2001 From: Zhong <58726932+cszhjh@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:16:37 +0800 Subject: [PATCH] fix(component): resolve the defaultValue error in setting the date type (#3652) closed #3651 --- src/components/Form/src/BasicForm.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Form/src/BasicForm.vue b/src/components/Form/src/BasicForm.vue index e509b6b2f..62c321b1b 100644 --- a/src/components/Form/src/BasicForm.vue +++ b/src/components/Form/src/BasicForm.vue @@ -123,7 +123,7 @@ const getBindValue = computed(() => ({ ...attrs, ...props, ...unref(getProps) }) as AntFormProps); const getSchema = computed((): FormSchema[] => { - const schemas: FormSchema[] = unref(schemaRef) || (unref(getProps).schemas as any); + const schemas: FormSchema[] = cloneDeep(unref(schemaRef) || (unref(getProps).schemas as any)); for (const schema of schemas) { const { defaultValue, @@ -163,11 +163,11 @@ } } if (unref(getProps).showAdvancedButton) { - return cloneDeep( - schemas.filter((schema) => !isIncludeSimpleComponents(schema.component)) as FormSchema[], - ); + return schemas.filter( + (schema) => !isIncludeSimpleComponents(schema.component), + ) as FormSchema[]; } else { - return cloneDeep(schemas as FormSchema[]); + return schemas as FormSchema[]; } });