Commit 0e13dab6 authored by baiyaaaaa's avatar baiyaaaaa Committed by GitHub

Merge pull request #2372 from QingWei-Li/fix/table-fixed-column

Table: fix fixed column height when empty data, fixed #2300
parents bee6c5bd 8498656f
...@@ -69,6 +69,7 @@ class TableLayout { ...@@ -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 { ...@@ -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() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment