Table: fix fixed column height when empty data, fixed #2300

pull/2372/head
qingwei.li 2017-01-12 16:12:32 +08:00
parent 5753b452af
commit 8498656f68
1 changed files with 2 additions and 1 deletions

View File

@ -69,6 +69,7 @@ class TableLayout {
updateHeight() { updateHeight() {
const height = this.tableHeight = this.table.$el.clientHeight; const height = this.tableHeight = this.table.$el.clientHeight;
const noData = !this.table.data || this.table.data.length === 0;
const { headerWrapper } = this.table.$refs; const { headerWrapper } = this.table.$refs;
if (this.showHeader && !headerWrapper) return; if (this.showHeader && !headerWrapper) return;
if (!this.showHeader) { if (!this.showHeader) {
@ -85,7 +86,7 @@ class TableLayout {
} }
this.fixedBodyHeight = this.scrollX ? bodyHeight - this.gutterWidth : bodyHeight; 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() { update() {