|
|
@@ -1,4 +1,4 @@
|
|
|
-import { reactive, ref } from "vue";
|
|
|
+import { ref } from "vue";
|
|
|
import { TableEventCB } from './interface';
|
|
|
|
|
|
/**
|
|
|
@@ -10,11 +10,11 @@ export function getTableEvent<T>(param: TableEventCB) {
|
|
|
// 表格展开行
|
|
|
const expandedRowKeys = ref<string[]>([]);
|
|
|
// 表格选中的数据
|
|
|
- const selectedRow = reactive({})
|
|
|
+ const selectedRow = ref({})
|
|
|
function Rowclick(record: T, index: number) {
|
|
|
return {
|
|
|
onClick: () => { // 表格点击
|
|
|
- Object.assign(selectedRow, record)
|
|
|
+ selectedRow.value = record
|
|
|
const value = expandedRowKeys.value;
|
|
|
expandedRowKeys.value = value.length ? [] : [`${index}`];
|
|
|
param.clickCB && param.clickCB()
|
|
|
@@ -23,7 +23,7 @@ export function getTableEvent<T>(param: TableEventCB) {
|
|
|
// console.log('onDblclick');
|
|
|
// },
|
|
|
onContextmenu: () => { // 表格右键
|
|
|
- Object.assign(selectedRow, record)
|
|
|
+ selectedRow.value = record
|
|
|
param.contextmenuCB && param.contextmenuCB()
|
|
|
},
|
|
|
};
|