[添加] table的tr中的contextmenu事件,用于集成行及右键菜单处理

This commit is contained in:
鄢鹏权 2022-03-28 06:46:34 +00:00 committed by Gitee
parent 8752a62cc1
commit 3f088b4dca
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -101,6 +101,10 @@ const rowDoubleClick = function (data: any,evt:MouseEvent) {
emit("row-double", data,evt); emit("row-double", data,evt);
}; };
const contextmenu = function (data: any,evt:MouseEvent) {
emit("contextmenu", data,evt);
};
// table // table
const print = function () { const print = function () {
let subOutputRankPrint = document.getElementById(tableId) as HTMLElement; let subOutputRankPrint = document.getElementById(tableId) as HTMLElement;
@ -290,6 +294,7 @@ onMounted(() => {
<tr <tr
@click.stop="rowClick(data,$event)" @click.stop="rowClick(data,$event)"
@dblclick.stop="rowDoubleClick(data,$event)" @dblclick.stop="rowDoubleClick(data,$event)"
@contextmenu.stop="contextmenu(data,$event)"
> >
<!-- 复选框 --> <!-- 复选框 -->
<td v-if="checkbox" class="layui-table-col-special"> <td v-if="checkbox" class="layui-table-col-special">