diff --git a/packages/components/table/src/table-layout.ts b/packages/components/table/src/table-layout.ts index 6dd5276594..923f888bb2 100644 --- a/packages/components/table/src/table-layout.ts +++ b/packages/components/table/src/table-layout.ts @@ -148,18 +148,21 @@ class TableLayout { // avoid v-show return } + const { tableLayout } = this.table.props this.appendHeight.value = appendWrapper ? appendWrapper.offsetHeight : 0 - if (this.showHeader && !headerWrapper) return + if (this.showHeader && !headerWrapper && tableLayout === 'fixed') { + return + } const headerTrElm: HTMLElement = tableHeader ? tableHeader : null const noneHeader = this.headerDisplayNone(headerTrElm) - + const headerWrapperOffsetHeight = headerWrapper?.offsetHeight || 0 const headerHeight = (this.headerHeight.value = !this.showHeader ? 0 - : headerWrapper.offsetHeight) + : headerWrapperOffsetHeight) if ( this.showHeader && !noneHeader && - headerWrapper.offsetWidth > 0 && + headerWrapperOffsetHeight > 0 && (this.table.store.states.columns.value || []).length > 0 && headerHeight < 2 ) {