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

View File

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