mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-27 05:15:43 +08:00
fix(useTableFooter): not synchronization scroll bug (#2022)
Co-authored-by: 隆杰 <longjie.li@taxsoyea.net>
This commit is contained in:
parent
4730b3af31
commit
0f50e0458e
@ -36,14 +36,13 @@ export function useTableFooter(
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const tableEl = unref(tableElRef);
|
const tableEl = unref(tableElRef);
|
||||||
if (!tableEl) return;
|
if (!tableEl) return;
|
||||||
const bodyDomList = tableEl.$el.querySelectorAll('.ant-table-body');
|
const bodyDom = tableEl.$el.querySelector('.ant-table-content');
|
||||||
const bodyDom = bodyDomList[0];
|
|
||||||
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-body',
|
'.ant-table-footer .ant-table-content',
|
||||||
) as HTMLDivElement;
|
) as HTMLDivElement;
|
||||||
if (!footerBodyDom || !bodyDom) return;
|
if (!footerBodyDom || !bodyDom) return;
|
||||||
footerBodyDom.scrollLeft = bodyDom.scrollLeft;
|
footerBodyDom.scrollLeft = bodyDom.scrollLeft;
|
||||||
|
Loading…
Reference in New Issue
Block a user