修复 数据更改后没折叠表单

This commit is contained in:
小肥羊 2025-09-25 13:51:19 +08:00
parent b56c9f819a
commit 4bc9a0a606
1 changed files with 4 additions and 1 deletions

View File

@ -44,7 +44,7 @@ const props = defineProps({
default: () => ({}), default: () => ({}),
}, },
}); });
const expands = ref<any[]>();
const table = ref<TableConfig>(props.tableConfig); const table = ref<TableConfig>(props.tableConfig);
const tableShowColumn = ref<Record<string, TableColumn>>(); const tableShowColumn = ref<Record<string, TableColumn>>();
onBeforeMount(() => { onBeforeMount(() => {
@ -338,6 +338,8 @@ function handleReloadPaged(reload = true) {
if (table.value.searchCallback) { if (table.value.searchCallback) {
table.value.searchCallback(table.value.search); table.value.searchCallback(table.value.search);
} }
//
if (table.value.expandColumn) expands.value = [];
fetchPagedData(); fetchPagedData();
} }
// //
@ -459,6 +461,7 @@ function fetchPagedData() {
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@sort-change="sortChange" @sort-change="sortChange"
@expand-change="table.expandChange" @expand-change="table.expandChange"
:expand-row-keys="expands"
> >
<el-table-column v-if="table.selectColumn" type="selection" width="40" /> <el-table-column v-if="table.selectColumn" type="selection" width="40" />
<el-table-column <el-table-column