diff --git a/src/table/base-table.tsx b/src/table/base-table.tsx index 45416e61b..6c706577b 100644 --- a/src/table/base-table.tsx +++ b/src/table/base-table.tsx @@ -30,6 +30,7 @@ import { ROW_LISTENERS } from './tr'; import THead from './thead'; import TFoot from './tfoot'; import log from '../_common/js/log'; +import { getIEVersion } from '../_common/js/utils/helper'; import { getAffixProps } from './utils'; export const BASE_TABLE_EVENTS = ['page-change', 'cell-click', 'scroll', 'scrollX', 'scrollY']; @@ -303,7 +304,10 @@ export default defineComponent({ const onlyVirtualScrollBordered = !!(this.isVirtual && !this.headerAffixedTop && this.bordered) && /Chrome/.test(navigator?.userAgent); const borderWidth = this.bordered && onlyVirtualScrollBordered ? 1 : 0; const barWidth = this.isWidthOverflow ? this.scrollbarWidth : 0; - const affixHeaderWrapHeight = (this.affixHeaderRef?.getBoundingClientRect().height || 0) - barWidth - borderWidth; + // IE浏览器需要遮挡header吸顶滚动条,要减去getBoundingClientRect.height的滚动条高度4像素 + const IEHeaderWrap = getIEVersion() <= 11 ? 4 : 0; + const affixHeaderHeight = (this.affixHeaderRef?.getBoundingClientRect().height || 0) - IEHeaderWrap; + const affixHeaderWrapHeight = affixHeaderHeight - barWidth - borderWidth; // 两类场景:1. 虚拟滚动,永久显示表头,直到表头消失在可视区域; 2. 表头吸顶,根据滚动情况判断是否显示吸顶表头 const headerOpacity = props.headerAffixedTop ? Number(this.showAffixHeader) : 1; const affixHeaderWrapHeightStyle = {