Skip to content

Commit

Permalink
Table: fix fixed column height when empty data, fixed ElemeFE#2300
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Jan 12, 2017
1 parent 5753b45 commit 8498656
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/table/src/table-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class TableLayout {

updateHeight() {
const height = this.tableHeight = this.table.$el.clientHeight;
const noData = !this.table.data || this.table.data.length === 0;
const { headerWrapper } = this.table.$refs;
if (this.showHeader && !headerWrapper) return;
if (!this.showHeader) {
Expand All @@ -85,7 +86,7 @@ class TableLayout {
}
this.fixedBodyHeight = this.scrollX ? bodyHeight - this.gutterWidth : bodyHeight;
}
this.viewportHeight = this.scrollX ? height - this.gutterWidth : height;
this.viewportHeight = this.scrollX ? height - (noData ? 0 : this.gutterWidth) : height;
}

update() {
Expand Down

0 comments on commit 8498656

Please sign in to comment.