Browse Source

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

pull/3441/head
松鼠 3 years ago
committed by GitHub
parent
commit
7ba83e71bf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/components/Table/src/hooks/useTableFooter.ts

4
src/components/Table/src/hooks/useTableFooter.ts

@ -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;

Loading…
Cancel
Save