From a908e49fb451f2d33e5a2594b3d49b8b9004a0af Mon Sep 17 00:00:00 2001 From: sheepluo Date: Wed, 29 Jun 2022 10:51:02 +0800 Subject: [PATCH] feat(table): paginationAffixProps & affixed Header (#1102) --- src/table/base-table.tsx | 11 ++++++++++- src/table/hooks/useAffix.ts | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/table/base-table.tsx b/src/table/base-table.tsx index 552c74a79c..910393c858 100644 --- a/src/table/base-table.tsx +++ b/src/table/base-table.tsx @@ -92,6 +92,7 @@ export default defineComponent({ showAffixPagination, onHorizontalScroll, setTableContentRef, + updateAffixHeaderOrFooter, } = useAffix(props); const { isMultipleHeader, spansAndLeafNodes, thList } = useTableHeader(props); @@ -145,6 +146,7 @@ export default defineComponent({ const onFixedChange = () => { nextTick(() => { onHorizontalScroll(); + updateAffixHeaderOrFooter(); }); }; @@ -255,6 +257,7 @@ export default defineComponent({ handleRowMounted, onFixedChange, onHorizontalScroll, + updateAffixHeaderOrFooter, refreshTable, onInnerVirtualScroll, }; @@ -508,7 +511,13 @@ export default defineComponent({ )} {/* 吸底的分页器 */} - {this.paginationAffixedBottom ? {pagination} : pagination} + {this.paginationAffixedBottom ? ( + + {pagination} + + ) : ( + pagination + )} {/* 调整列宽时的指示线。由于层级需要比较高,因而放在根节点,避免被吸顶表头覆盖。非必要情况,请勿调整辅助线位置 */}
diff --git a/src/table/hooks/useAffix.ts b/src/table/hooks/useAffix.ts index 0bc9cbe7f2..ff2b8bce91 100644 --- a/src/table/hooks/useAffix.ts +++ b/src/table/hooks/useAffix.ts @@ -245,5 +245,6 @@ export default function useAffix(props: TdBaseTableProps) { paginationRef, onHorizontalScroll, setTableContentRef, + updateAffixHeaderOrFooter, }; }