修复 table 在某些情况设置 `lay-unrow` 无效的问题

pull/1281/head
贤心 2023-06-12 14:59:35 +08:00
parent b3c19e064d
commit 7418eddb54
1 changed files with 2 additions and 6 deletions

View File

@ -2274,12 +2274,8 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
that.layBody.find('tr:eq('+ index +')').removeClass(ELEM_HOVER)
}).on('click', 'tr', function(e){ // 单击行
// 不支持行单击事件的元素
var UNROW = '.layui-form-checkbox,.layui-form-radio,[lay-unrow]';
var container = $(this).find(UNROW);
if(
$(e.target).is(UNROW) ||
container[0] && $.contains(container[0], e.target)
){
var UNROW = '.layui-form-checkbox,.layui-form-switch,.layui-form-radio,[lay-unrow]';
if( $(e.target).is(UNROW) || $(e.target).closest(UNROW)[0]){
return;
};
setRowEvent.call(this, 'row');