diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index 7056b838..306e5d02 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -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); // 根据实际的唯一标识 } }, };