From af230636a64fc9bf4f42dc98d1ec7faa905cd496 Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Fri, 1 Dec 2023 12:35:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20table=20height=20=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E6=96=87=E6=A1=A3=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=B1=BB=E5=9E=8B=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/table/detail/options.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/table/detail/options.md b/docs/table/detail/options.md index dc3baf41..97d996ad 100644 --- a/docs/table/detail/options.md +++ b/docs/table/detail/options.md @@ -123,6 +123,17 @@ - `height: 'full-30'` 设置相对可视屏幕的高度铺满。这是一个特定的语法格式:`full` 表示铺满;后面的数字表示当前 table 之外的元素占用的高度,如:表格头部到页面最顶部*加*表格底部距离页面最底部的“距离和” - `height: '#id-30'` 设置相对父元素的高度铺满,其中 `#id` 即父元素的 ID 选择器,其计算原理和上述 `full` 相同。 +**函数写法** 2.9.1+ + +当需要动态改变表格高度时建议使用,如下以等效 `full-xx` 的写法为例: + +``` +height: function(){ + var otherHeight = $('#search-content').outerHeight(); // 自定义其他区域的高度 + return $(window).height() - otherHeight; // 返回 number 类型 +} +``` +