Browse Source
fix(useTableFooter): not synchronization scroll bug (#2022)
Co-authored-by: 隆杰 <longjie.li@taxsoyea.net>
pull/2041/head
BlackTooth
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
3 deletions
-
src/components/Table/src/hooks/useTableFooter.ts
|
|
|
@ -36,14 +36,13 @@ export function useTableFooter( |
|
|
|
nextTick(() => { |
|
|
|
const tableEl = unref(tableElRef); |
|
|
|
if (!tableEl) return; |
|
|
|
const bodyDomList = tableEl.$el.querySelectorAll('.ant-table-body'); |
|
|
|
const bodyDom = bodyDomList[0]; |
|
|
|
const bodyDom = tableEl.$el.querySelector('.ant-table-content'); |
|
|
|
useEventListener({ |
|
|
|
el: bodyDom, |
|
|
|
name: 'scroll', |
|
|
|
listener: () => { |
|
|
|
const footerBodyDom = tableEl.$el.querySelector( |
|
|
|
'.ant-table-footer .ant-table-body', |
|
|
|
'.ant-table-footer .ant-table-content', |
|
|
|
) as HTMLDivElement; |
|
|
|
if (!footerBodyDom || !bodyDom) return; |
|
|
|
footerBodyDom.scrollLeft = bodyDom.scrollLeft; |
|
|
|
|