From ef1b952068720f73df102b3d6c33631ba4d284bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:50:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20`table.reload()`=20?= =?UTF-8?q?=E9=80=A0=E6=88=90=20`window=20resize`=20=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=BB=91=E5=AE=9A=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index 30b7b83b..8dd1def4 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -2494,21 +2494,23 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ layer.close(that.tipsIndex); }); + }; - // 适应 + // 全局事件 + (function(){ + // 自适应尺寸 _WIN.on('resize', function(){ - that.resize(); + layui.each(thisTable.that, function(){ + this.resize(); + }); }); - }; - //一次性事件 - ;(function(){ - //全局点击 + // 全局点击 _DOC.on('click', function(){ _DOC.trigger('table.remove.tool.panel'); }); - //工具面板移除事件 + // 工具面板移除事件 _DOC.on('table.remove.tool.panel', function(){ $('.' + ELEM_TOOL_PANEL).remove(); });