fix(BasicTable): 滑动表格内容合计行不跟随滑动bug (#3438) resolve #2166

This commit is contained in:
松鼠 2023-12-19 14:42:35 +08:00 committed by GitHub
parent b008c44246
commit 7ba83e71bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -36,13 +36,13 @@ export function useTableFooter(
nextTick(() => { nextTick(() => {
const tableEl = unref(tableElRef); const tableEl = unref(tableElRef);
if (!tableEl) return; if (!tableEl) return;
const bodyDom = tableEl.$el.querySelector('.ant-table-content'); const bodyDom = tableEl.$el.querySelector(' .ant-table-content, .ant-table-body');
useEventListener({ useEventListener({
el: bodyDom, el: bodyDom,
name: 'scroll', name: 'scroll',
listener: () => { listener: () => {
const footerBodyDom = tableEl.$el.querySelector( const footerBodyDom = tableEl.$el.querySelector(
'.ant-table-footer .ant-table-content', '.ant-table-footer .ant-table-container [class^="ant-table-"]',
) as HTMLDivElement; ) as HTMLDivElement;
if (!footerBodyDom || !bodyDom) return; if (!footerBodyDom || !bodyDom) return;
footerBodyDom.scrollLeft = bodyDom.scrollLeft; footerBodyDom.scrollLeft = bodyDom.scrollLeft;