mirror of https://github.com/ElemeFE/element
fix table will crash when initial columns is empty (#9666)
parent
f255c8786e
commit
580aaaa3f9
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue