mirror of https://github.com/layui/layui
Merge pull request #1110 from SunJary/fix_table_none_width
当列超出屏幕范围、并且 无数据(或请求异常) 时 table组件底部没有横向滚动条,以至于无法看到剩余的列。增加底部滚动条,以便查看所有的列pull/1117/head
commit
049f636983
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue