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

pull/9686/head
FuryBean 2018-02-05 19:22:24 +08:00 committed by 杨奕
parent f255c8786e
commit 580aaaa3f9
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ class TableLayout {
if (this.showHeader && !headerWrapper) return;
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());
}
const tableHeight = this.tableHeight = this.table.$el.clientHeight;