Commit 6353d33a authored by FuryBean's avatar FuryBean Committed by cinwell.li

Table: fix a script error when show-header is true. (#1248)

parent 34e01710
......@@ -194,20 +194,22 @@
const { bodyWrapper, headerWrapper } = this.$refs;
const refs = this.$refs;
bodyWrapper.addEventListener('scroll', function() {
headerWrapper.scrollLeft = this.scrollLeft;
if (headerWrapper) headerWrapper.scrollLeft = this.scrollLeft;
if (refs.fixedBodyWrapper) refs.fixedBodyWrapper.scrollTop = this.scrollTop;
if (refs.rightFixedBodyWrapper) refs.rightFixedBodyWrapper.scrollTop = this.scrollTop;
});
mousewheel(headerWrapper, throttle(16, function(event) {
const deltaX = event.deltaX;
if (headerWrapper) {
mousewheel(headerWrapper, throttle(16, function(event) {
const deltaX = event.deltaX;
if (deltaX > 0) {
bodyWrapper.scrollLeft = bodyWrapper.scrollLeft + 10;
} else {
bodyWrapper.scrollLeft = bodyWrapper.scrollLeft - 10;
}
}));
if (deltaX > 0) {
bodyWrapper.scrollLeft = bodyWrapper.scrollLeft + 10;
} else {
bodyWrapper.scrollLeft = bodyWrapper.scrollLeft - 10;
}
}));
}
if (this.fit) {
this.windowResizeListener = throttle(50, () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment