fix:表格展开问题修改
This commit is contained in:
parent
5b007a536d
commit
d599261715
|
|
@ -138,6 +138,7 @@ export default {
|
||||||
hideExport: { type: Boolean, default: false },
|
hideExport: { type: Boolean, default: false },
|
||||||
hExportCols: { type: Array, default: null },
|
hExportCols: { type: Array, default: null },
|
||||||
hExportName: { type: String, default: null },
|
hExportName: { type: String, default: null },
|
||||||
|
slotColumns: { type: Array, default: null },
|
||||||
paginationLayout: { type: String, default: config.paginationLayout },
|
paginationLayout: { type: String, default: config.paginationLayout },
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -562,16 +563,16 @@ export default {
|
||||||
},
|
},
|
||||||
// 控制展开/收起所有行
|
// 控制展开/收起所有行
|
||||||
toggleExpandAll() {
|
toggleExpandAll() {
|
||||||
const isExpandAll = this.expandRowKeys.length === this.$refs.scTable.data.length;
|
const isExpandAll = this.expandRowKeys.length === this.tableData.length;
|
||||||
if (isExpandAll) {
|
if (isExpandAll) {
|
||||||
this.expandRowKeys = []; // 收起所有
|
this.expandRowKeys = []; // 收起所有
|
||||||
} else {
|
} else {
|
||||||
this.expandRowKeys = this.$refs.scTable.data.map(item => item.id); // 展开所有
|
this.expandRowKeys = this.tableData.map(item => item.id); // 展开所有
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 每次展开状态变化时更新 expandRowKeys
|
// 每次展开状态变化时更新 expandRowKeys
|
||||||
handleExpandChange(row, expandedRows) {
|
handleExpandChange(row, expandedRows) {
|
||||||
this.expandRowKeys = expandedRows.map(row => row.is); // 根据实际的唯一标识
|
this.expandRowKeys = expandedRows.map(row => row.id); // 根据实际的唯一标识
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue