Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/form/src/containers/GroupList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:config="config"
:prop="prop"
:index="index"
:expand="item.expand"
:label-width="labelWidth"
:size="size"
:disabled="disabled"
Expand Down
6 changes: 5 additions & 1 deletion packages/form/src/containers/GroupListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ const props = defineProps<{
const emit = defineEmits(['swap-item', 'remove-item', 'change', 'addDiffCount', 'copy-item']);

const mForm = inject<FormState | undefined>('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',
Expand Down Expand Up @@ -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);
};

// 希望支持单行可控制是否显示删除按钮,不会影响现有逻辑
Expand Down