fix:表格展开问题修改

This commit is contained in:
shijing 2026-07-28 15:44:24 +08:00
parent 5b007a536d
commit d599261715
1 changed files with 4 additions and 3 deletions

View File

@ -138,6 +138,7 @@ export default {
hideExport: { type: Boolean, default: false },
hExportCols: { type: Array, default: null },
hExportName: { type: String, default: null },
slotColumns: { type: Array, default: null },
paginationLayout: { type: String, default: config.paginationLayout },
},
watch: {
@ -562,16 +563,16 @@ export default {
},
// /
toggleExpandAll() {
const isExpandAll = this.expandRowKeys.length === this.$refs.scTable.data.length;
const isExpandAll = this.expandRowKeys.length === this.tableData.length;
if (isExpandAll) {
this.expandRowKeys = []; //
} else {
this.expandRowKeys = this.$refs.scTable.data.map(item => item.id); //
this.expandRowKeys = this.tableData.map(item => item.id); //
}
},
// expandRowKeys
handleExpandChange(row, expandedRows) {
this.expandRowKeys = expandedRows.map(row => row.is); //
this.expandRowKeys = expandedRows.map(row => row.id); //
}
},
};