|
|
@@ -15,7 +15,13 @@ export function getTableEvent<T>(param: TableEventCB) {
|
|
|
return {
|
|
|
onClick: () => { // 表格点击
|
|
|
selectedRow.value = record
|
|
|
- expandedRowKeys.value = [(record as any).key]
|
|
|
+ const key = (record as any).key
|
|
|
+ const value = expandedRowKeys.value;
|
|
|
+ if(value && value.length && value[0] === key) {
|
|
|
+ expandedRowKeys.value = []
|
|
|
+ } else {
|
|
|
+ expandedRowKeys.value = [key]
|
|
|
+ }
|
|
|
param.clickCB && param.clickCB()
|
|
|
},
|
|
|
// onDblclick: () => { // 双击
|