Commit 580aaaa3 authored by FuryBean's avatar FuryBean Committed by 杨奕

fix table will crash when initial columns is empty (#9666)

parent f255c878
...@@ -79,7 +79,7 @@ class TableLayout { ...@@ -79,7 +79,7 @@ class TableLayout {
if (this.showHeader && !headerWrapper) return; if (this.showHeader && !headerWrapper) return;
const headerHeight = this.headerHeight = !this.showHeader ? 0 : headerWrapper.offsetHeight; const headerHeight = this.headerHeight = !this.showHeader ? 0 : headerWrapper.offsetHeight;
if (this.showHeader && headerWrapper.offsetWidth > 0 && headerHeight < 2) { if (this.showHeader && headerWrapper.offsetWidth > 0 && (this.table.columns || []).length > 0 && headerHeight < 2) {
return Vue.nextTick(() => this.updateElsHeight()); return Vue.nextTick(() => this.updateElsHeight());
} }
const tableHeight = this.tableHeight = this.table.$el.clientHeight; const tableHeight = this.tableHeight = this.table.$el.clientHeight;
......
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