huangbin 4 éve
szülő
commit
040328dcb0

+ 1 - 5
src/common/components/contextMenu/index.vue

@@ -44,14 +44,10 @@ export default defineComponent({
 
         function onContextMenu(value: MouseEvent) {
             const target = value.target as any;
-            // 获取点击表格的 tr  所在的 索引位置
-            const index = target.parentElement.rowIndex;
-            // 过滤右键表头
-            if (index) {
+            if (target.nodeName === 'TD') {  // 过滤右键表头
                 const { clientX, clientY } = value;
                 Object.assign(menuContext.position, { clientX, clientY });
                 menuContext.show = true;
-                // menuContext.selectedData = props.tableList[index - 1];
             }
         }
         // 关闭右键弹窗

+ 0 - 2
src/common/setup/table/event.ts

@@ -34,8 +34,6 @@ export function getTableEvent<T>(param: TableEventCB) {
         };
     }
     function btnClick(record: T) {
-        console.log('record', record);
-
         selectedRow.value = record
     }
     return { expandedRowKeys, selectedRow, Rowclick, btnClick }