diff --git a/docs/table/detail/options.md b/docs/table/detail/options.md index f9053930..39a77810 100644 --- a/docs/table/detail/options.md +++ b/docs/table/detail/options.md @@ -254,6 +254,16 @@ height: function(){ string +- + + +syncFixedRowHeight 2.12+ 实验性 + + +是否强制计算表格主区域的行高度并同步到固定列区域。开启后会对表格性能有一定的影响,仅适用于行高度自适应的场景。 + + +boolean - diff --git a/src/modules/table.js b/src/modules/table.js index 088fae2d..82219a47 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -2993,7 +2993,7 @@ layui.define(['lay', 'i18n', 'laytpl', 'laypage', 'form', 'util'], function(expo // 同步固定列表格和主表格高度 var lineStyle = that.config.lineStyle; - var isAutoHeight = lineStyle && (/\bheight\s*:\s*auto\b/g.test(lineStyle) || lineStyle.indexOf('max-height') !== -1); + var isAutoHeight = lineStyle && /\bheight\s*:\s*auto\b/g.test(lineStyle); // 只重载数据时需要主动同步高度,因为 tbody 大小可能不变 var needSyncFixedColHeight = that.needSyncFixedColHeight = (that.layBody.length > 1) && (that.config.syncFixedRowHeight || (that.config.syncFixedRowHeight !== false && isAutoHeight));