Skip to content

Commit

Permalink
fix(Table): 🐛 修复元素可能为空引起的报错 (#4676)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cat1007 authored Oct 24, 2024
1 parent d4445b3 commit 3fdef86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/table/hooks/useAffix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function useAffix(props: TdBaseTableProps) {
};

const updateAffixHeaderOrFooter = () => {
if (!isAffixed.value && !isVirtualScroll.value) return;
if (!isAffixed.value && !isVirtualScroll.value && !tableContentRef.value) return;
const pos = tableContentRef.value?.getBoundingClientRect();
const headerRect = tableContentRef.value?.querySelector('thead')?.getBoundingClientRect();
const headerHeight = headerRect?.height || 0;
Expand Down

0 comments on commit 3fdef86

Please sign in to comment.