From e4ae678cb7c3780379f82557e1440e6df3de30c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:30:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20table=20=E7=9A=84=20`heigh?= =?UTF-8?q?t:'#id-0'`=20=E8=A1=A8=E8=BE=BE=E5=BC=8F=E5=9C=A8=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=20resize=20=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index 3990c889..2b0d7ef4 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -353,13 +353,13 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ // 高度铺满:full-差距值 if(options.height && /^full-.+$/.test(options.height)){ - that.fullHeightGap = parseFloat(options.height.split('-')[1]) || 0; - options.height = _WIN.height() - that.fullHeightGap; + that.fullHeightGap = options.height.split('-')[1]; + options.height = _WIN.height() - (parseFloat(that.fullHeightGap) || 0); } else if (options.height && /^#\w+\S*-.+$/.test(options.height)) { var parentDiv = options.height.split("-"); - that.parentHeightGap = parseFloat(parentDiv.pop()) || 0; + that.parentHeightGap = parentDiv.pop(); that.parentDiv = parentDiv.join("-"); - options.height = $(that.parentDiv).height() - that.parentHeightGap; + options.height = $(that.parentDiv).height() - (parseFloat(that.parentHeightGap) || 0); } // 开始插入替代元素