Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Table] 吸顶吸底功能支持带有 offsetBottom 和 offsetTop 特性的位置定位 #985

Merged
merged 24 commits into from
Jun 12, 2022
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
49072ba
docs(notification): 插件调用与函数式调用
Feb 11, 2022
8e5badf
Merge remote-tracking branch 'upstream/develop' into develop
Feb 14, 2022
5d3dd2a
Merge remote-tracking branch 'upstream/develop' into develop
Feb 15, 2022
df1f39a
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Mar 23, 2022
e9a6f2e
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Mar 28, 2022
993a2a4
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Mar 29, 2022
bbe4c10
fix(table): merged cells border style
chaishi Mar 29, 2022
51a9b4b
feat: merge from upstream/develop
chaishi Mar 31, 2022
93a15e0
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Apr 21, 2022
e57dd2d
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Apr 25, 2022
36d3778
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Apr 30, 2022
1db46ab
Merge remote-tracking branch 'upstream/develop' into develop
chaishi May 10, 2022
edd9e3b
Merge remote-tracking branch 'upstream/develop' into develop
chaishi May 10, 2022
9b4b001
Merge remote-tracking branch 'upstream/develop' into develop
chaishi May 13, 2022
267b4ea
Merge remote-tracking branch 'upstream/develop' into develop
chaishi May 16, 2022
95996fe
Merge remote-tracking branch 'upstream/develop' into develop
chaishi May 21, 2022
871f1b1
fix(table): toggleData and FoldAll
chaishi May 21, 2022
f5bb2e9
fix(table): 树形结构中,动态设置行选中列时,禁用功能失效
chaishi May 21, 2022
d310f05
Merge remote-tracking branch 'upstream/develop' into develop
chaishi May 29, 2022
7456a08
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Jun 4, 2022
93e760c
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Jun 5, 2022
2104f83
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Jun 10, 2022
5565aee
Merge remote-tracking branch 'upstream/develop' into develop
chaishi Jun 11, 2022
f2111d9
feat: 表头吸底和吸顶优化
chaishi Jun 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/table/hooks/useFixed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,17 @@ export default function useFixed(props: TdBaseTableProps, context: SetupContext)

const updateAffixHeaderOrFooter = () => {
const pos = tableContentRef.value.getBoundingClientRect();
if (props.headerAffixedTop || props.scroll?.type === 'virtual') {
const r = affixHeaderRef.value?.offsetHeight - pos.top < pos.height;
if ((props.headerAffixedTop || props.scroll?.type === 'virtual') && affixHeaderRef.value) {
const headerRect = affixHeaderRef.value.getBoundingClientRect();
const offsetTop = props.headerAffixProps?.offsetTop || 0;
const footerHeight = affixFooterRef?.value?.offsetHeight || 0;
const r = Math.abs(pos.top) < pos.height - headerRect.height - offsetTop - footerHeight;
showAffixHeader.value = r;
}
if (props.footerAffixedBottom) {
showAffixFooter.value = pos.top + (affixFooterRef?.value?.clientHeight || 48) <= window.innerHeight
&& -1 * pos.top < (tableContentRef?.value?.parentNode as HTMLDivElement)?.clientHeight;
if (props.footerAffixedBottom && affixFooterRef?.value) {
const footerRect = affixFooterRef.value.getBoundingClientRect();
const headerHeight = affixHeaderRef?.value?.offsetHeight || 0;
showAffixFooter.value = pos.top + headerHeight < footerRect.top && footerRect.top > footerRect.height;
}
};

Expand Down