优化 table 的 `height` 属性高度铺满语法中不支持浮点型数值的问题

pull/1426/head
贤心 2023-11-19 17:51:34 +08:00
parent 4a7ff50de8
commit b6270b228e
1 changed files with 6 additions and 6 deletions

View File

@ -348,16 +348,16 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
options.index = that.index;
that.key = options.id || options.index;
//初始化一些其他参数
// 初始化一些其他参数
that.setInit();
//高度铺满full-差距值
if(options.height && /^full-\d+$/.test(options.height)){
that.fullHeightGap = options.height.split('-')[1];
// 高度铺满full-差距值
if(options.height && /^full-.+$/.test(options.height)){
that.fullHeightGap = parseFloat(options.height.split('-')[1]) || 0;
options.height = _WIN.height() - that.fullHeightGap;
} else if (options.height && /^#\w+\S*-\d+$/.test(options.height)) {
} else if (options.height && /^#\w+\S*-.+$/.test(options.height)) {
var parentDiv = options.height.split("-");
that.parentHeightGap = parentDiv.pop();
that.parentHeightGap = parseFloat(parentDiv.pop()) || 0;
that.parentDiv = parentDiv.join("-");
options.height = $(that.parentDiv).height() - that.parentHeightGap;
}