From b751c7e3f0663a331ec9b0daac4795fb3598bcd8 Mon Sep 17 00:00:00 2001 From: undefined-qql Date: Tue, 27 May 2025 14:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3groupList=E9=87=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8F=98=E6=9B=B4=EF=BC=8Cgrouplistitem=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E7=BC=A9=E8=B5=B7=E7=9A=84=E6=83=85=E5=86=B5=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E6=93=8D=E4=BD=9C=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form/src/containers/GroupList.vue | 1 + packages/form/src/containers/GroupListItem.vue | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/form/src/containers/GroupList.vue b/packages/form/src/containers/GroupList.vue index 64818396..672277ac 100644 --- a/packages/form/src/containers/GroupList.vue +++ b/packages/form/src/containers/GroupList.vue @@ -15,6 +15,7 @@ :config="config" :prop="prop" :index="index" + :expand="item.expand" :label-width="labelWidth" :size="size" :disabled="disabled" diff --git a/packages/form/src/containers/GroupListItem.vue b/packages/form/src/containers/GroupListItem.vue index 765cc1a2..c2e85e81 100644 --- a/packages/form/src/containers/GroupListItem.vue +++ b/packages/form/src/containers/GroupListItem.vue @@ -133,7 +133,8 @@ const props = defineProps<{ const emit = defineEmits(['swap-item', 'remove-item', 'change', 'addDiffCount', 'copy-item']); const mForm = inject('mForm'); -const expand = ref(props.config.expandAll || !props.index); +// const expand = ref(props.config.expandAll || !props.index); +const expand = ref(props.config.expandAll ||props.model.expand); //解决每次变更值都收缩的问题 const rowConfig = computed(() => ({ type: 'row', @@ -164,11 +165,14 @@ const itemExtra = computed(() => filterFunction(mForm, props.config.itemExtra, p const removeHandler = () => emit('remove-item', props.index); const changeHandler = (v: any, eventData: ContainerChangeEventData) => { + props.model.expand=expand.value; emit('change', props.model, eventData); }; const expandHandler = () => { expand.value = !expand.value; + props.model.expand=expand.value; + emit('change', props.model); }; // 希望支持单行可控制是否显示删除按钮,不会影响现有逻辑