【issues/638】表格合计,列表table和合计table滚动联动

pull/975/head
zhangdaiscott 2023-12-05 12:04:15 +08:00
parent 37521946f8
commit c2bb591582
1 changed files with 0 additions and 32 deletions

View File

@ -375,38 +375,6 @@
emit('register', tableAction, formActions);
// update-begin--author:liaozhiyang---date:20230804---forissues/638tabletable
if (getProps.value.showSummary) {
let tableBody;
const handleSroll = function () {
const scrollLeft = this.scrollLeft;
tableBody.forEach((elem) => (elem.scrollLeft = scrollLeft));
};
onMounted(() => {
const unwatch = watch(
getDataSourceRef,
(newVal) => {
if (newVal.length > 0) {
setTimeout(() => {
unwatch();
tableBody = wrapRef.value.querySelectorAll('.ant-table-body');
tableBody.forEach((elem) => {
elem.addEventListener('scroll', handleSroll, false);
});
}, 0);
console.log("---表格合计滚动---")
}
},
{ immediate: true }
);
});
onUnmounted(() => {
if (tableBody.length) {
tableBody.forEach((elem) => elem.removeEventListener('scroll', handleSroll));
}
});
}
// update-begin--author:liaozhiyang---date:20230804---forissues/638tabletable
return {
tableElRef,