解决groupList里数据变更,grouplistitem重新缩起的情况,提升操作体验

This commit is contained in:
undefined-qql 2025-05-27 14:46:07 +08:00
parent c7b2734090
commit b751c7e3f0
2 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,7 @@
:config="config" :config="config"
:prop="prop" :prop="prop"
:index="index" :index="index"
:expand="item.expand"
:label-width="labelWidth" :label-width="labelWidth"
:size="size" :size="size"
:disabled="disabled" :disabled="disabled"

View File

@ -133,7 +133,8 @@ const props = defineProps<{
const emit = defineEmits(['swap-item', 'remove-item', 'change', 'addDiffCount', 'copy-item']); const emit = defineEmits(['swap-item', 'remove-item', 'change', 'addDiffCount', 'copy-item']);
const mForm = inject<FormState | undefined>('mForm'); 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(() => ({ const rowConfig = computed(() => ({
type: 'row', type: 'row',
@ -164,11 +165,14 @@ const itemExtra = computed(() => filterFunction(mForm, props.config.itemExtra, p
const removeHandler = () => emit('remove-item', props.index); const removeHandler = () => emit('remove-item', props.index);
const changeHandler = (v: any, eventData: ContainerChangeEventData) => { const changeHandler = (v: any, eventData: ContainerChangeEventData) => {
props.model.expand=expand.value;
emit('change', props.model, eventData); emit('change', props.model, eventData);
}; };
const expandHandler = () => { const expandHandler = () => {
expand.value = !expand.value; expand.value = !expand.value;
props.model.expand=expand.value;
emit('change', props.model);
}; };
// //