mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [el-table] cannot scroll when tableLayout is auto (#6790)
* fix(components): [el-table] cannot scroll when tableLayout is auto * chore: improve code
This commit is contained in:
@@ -148,18 +148,21 @@ class TableLayout<T> {
|
||||
// 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
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user