修复 table 的 height:'#id-0' 表达式在窗口 resize 无效的问题

This commit is contained in:
贤心 2023-11-28 16:30:10 +08:00
parent b92932c891
commit e4ae678cb7

View File

@ -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);
}
// 开始插入替代元素