From e9ddee165f89d68bfa46f61cf4565c8b11299e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Mon, 20 Feb 2023 00:14:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20table=20=E7=9A=84=20`setRo?= =?UTF-8?q?wChecked`=20=E6=96=B9=E6=B3=95=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index 0d7d6ecb..65db32c8 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1402,7 +1402,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ }; // 标记行选中状态 - Class.prototype.setRowChecked = function(opts, onlyStyle){ + Class.prototype.setRowChecked = function(opts, selectedStyle){ var that = this; var options = that.config; var ELEM_CLICK = 'layui-table-click'; @@ -1416,12 +1416,12 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ }, opts); // 标注当前行选中样式 - if(opts.type !== 'checkbox' && !opts.isAll){ + if(opts.type !== 'checkbox' && opts.index !== 'all'){ tr.addClass(ELEM_CLICK).siblings('tr').removeClass(ELEM_CLICK); } // 仅设置样式状态 - if(onlyStyle) return; + if(opts.selectedStyle || selectedStyle) return; // 同步数据选中属性值 var thisData = table.cache[that.key];