From 26063fbaf4b7ae492c3f07259d73cb8a2cccb4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 14 May 2023 20:30:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20table=20=E8=A1=8C=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81=E5=A4=84=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index e154f8f8..d75851b4 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -2209,24 +2209,24 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ }); // 行事件 - that.layBody.on('mouseenter', 'tr', function(){ //鼠标移入行 + that.layBody.on('mouseenter', 'tr', function(){ // 鼠标移入行 var othis = $(this); var index = othis.index(); - if(othis.data('off')) return; //不触发事件 + if(othis.data('off')) return; // 不触发事件 that.layBody.find('tr:eq('+ index +')').addClass(ELEM_HOVER) - }).on('mouseleave', 'tr', function(){ //鼠标移出行 + }).on('mouseleave', 'tr', function(){ // 鼠标移出行 var othis = $(this); var index = othis.index(); - if(othis.data('off')) return; //不触发事件 + if(othis.data('off')) return; // 不触发事件 that.layBody.find('tr:eq('+ index +')').removeClass(ELEM_HOVER) - }).on('click', 'tr', function(){ //单击行 + }).on('click', 'tr', function(){ // 单击行 setRowEvent.call(this, 'row'); - }).on('dblclick', 'tr', function(){ //双击行 + }).on('dblclick', 'tr', function(){ // 双击行 setRowEvent.call(this, 'rowDouble'); - }).on('contextmenu', 'tr', function(e){ //菜单 + }).on('contextmenu', 'tr', function(e){ // 菜单 if (!options.defaultContextmenu) e.preventDefault(); setRowEvent.call(this, 'rowContextmenu'); - });; + }); // 创建行单击、双击、菜单事件 var setRowEvent = function(eventType){