Merge pull request #1110 from SunJary/fix_table_none_width

当列超出屏幕范围、并且 无数据(或请求异常) 时 table组件底部没有横向滚动条,以至于无法看到剩余的列。增加底部滚动条,以便查看所有的列
pull/1117/head
贤心 2022-08-17 13:00:02 +08:00 committed by GitHub
commit 049f636983
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -790,7 +790,14 @@ layui.define(['laytpl', 'laypage', 'form', 'util'], function(exports){
}
that.setGroupWidth();
// 如果表格内容为空(无数据 或 请求异常)
if (that.layMain.find('tbody').is(":empty")) {
// 将表格宽度设置为跟表头一样的宽度,使之可以出现底部滚动条,以便滚动查看所有字段
const headerWidth = that.layHeader.first().children('table').width()
that.layMain.find('table').width(headerWidth);
}
that.loading(!0);
};