From 9fd8385651c895208a47eb621340a798fe3a4c93 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Fri, 28 Oct 2022 14:33:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(form):=20=E5=B1=95=E5=BC=80=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form/src/containers/Container.vue | 11 +++++++---- packages/form/src/utils/form.ts | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/form/src/containers/Container.vue b/packages/form/src/containers/Container.vue index 659ab0ed..e59037ff 100644 --- a/packages/form/src/containers/Container.vue +++ b/packages/form/src/containers/Container.vue @@ -97,7 +97,9 @@
- {{ expand ? '收起配置' : '展开更多配置' }} + {{ + expand ? '收起配置' : '展开更多配置' + }}
@@ -177,11 +179,12 @@ const type = computed((): string => { }); const display = computed((): boolean => { - if (props.config.display === 'expand') { + const value = displayFunction(mForm, props.config.display, props); + + if (value === 'expand') { return expand.value; } - - return displayFunction(mForm, props.config.display, props); + return value; }); const itemLabelWidth = computed(() => props.config.labelWidth || props.labelWidth); diff --git a/packages/form/src/utils/form.ts b/packages/form/src/utils/form.ts index c339ebf6..0a361750 100644 --- a/packages/form/src/utils/form.ts +++ b/packages/form/src/utils/form.ts @@ -197,6 +197,10 @@ export const filterFunction = (mForm: FormState | undefined, config: any, props: }; export const display = function (mForm: FormState | undefined, config: any, props: any) { + if (config === 'expand') { + return config; + } + if (typeof config === 'function') { return filterFunction(mForm, config, props); }