mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [table] header scroll height error (#9063)
This commit is contained in:
@@ -202,9 +202,10 @@ function useStyle<T>(
|
||||
}
|
||||
}
|
||||
const resizeListener = () => {
|
||||
if (!table.$ready) return
|
||||
let shouldUpdateLayout = false
|
||||
const el = table.vnode.el
|
||||
if (!table.$ready || !el) return
|
||||
|
||||
let shouldUpdateLayout = false
|
||||
const {
|
||||
width: oldWidth,
|
||||
height: oldHeight,
|
||||
@@ -221,7 +222,10 @@ function useStyle<T>(
|
||||
shouldUpdateLayout = true
|
||||
}
|
||||
|
||||
const tableHeader: HTMLElement = table.refs.headerWrapper
|
||||
const tableHeader: HTMLElement =
|
||||
props.tableLayout === 'fixed'
|
||||
? table.refs.headerWrapper
|
||||
: table.refs.tableHeaderRef?.$el
|
||||
if (props.showHeader && tableHeader?.offsetHeight !== oldHeaderHeight) {
|
||||
shouldUpdateLayout = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user