mirror of https://github.com/ElemeFE/element
Table: fix a script error when show-header is true. (#1248)
parent
34e01710b5
commit
6353d33afe
|
@ -194,20 +194,22 @@
|
||||||
const { bodyWrapper, headerWrapper } = this.$refs;
|
const { bodyWrapper, headerWrapper } = this.$refs;
|
||||||
const refs = this.$refs;
|
const refs = this.$refs;
|
||||||
bodyWrapper.addEventListener('scroll', function() {
|
bodyWrapper.addEventListener('scroll', function() {
|
||||||
headerWrapper.scrollLeft = this.scrollLeft;
|
if (headerWrapper) headerWrapper.scrollLeft = this.scrollLeft;
|
||||||
if (refs.fixedBodyWrapper) refs.fixedBodyWrapper.scrollTop = this.scrollTop;
|
if (refs.fixedBodyWrapper) refs.fixedBodyWrapper.scrollTop = this.scrollTop;
|
||||||
if (refs.rightFixedBodyWrapper) refs.rightFixedBodyWrapper.scrollTop = this.scrollTop;
|
if (refs.rightFixedBodyWrapper) refs.rightFixedBodyWrapper.scrollTop = this.scrollTop;
|
||||||
});
|
});
|
||||||
|
|
||||||
mousewheel(headerWrapper, throttle(16, function(event) {
|
if (headerWrapper) {
|
||||||
const deltaX = event.deltaX;
|
mousewheel(headerWrapper, throttle(16, function(event) {
|
||||||
|
const deltaX = event.deltaX;
|
||||||
|
|
||||||
if (deltaX > 0) {
|
if (deltaX > 0) {
|
||||||
bodyWrapper.scrollLeft = bodyWrapper.scrollLeft + 10;
|
bodyWrapper.scrollLeft = bodyWrapper.scrollLeft + 10;
|
||||||
} else {
|
} else {
|
||||||
bodyWrapper.scrollLeft = bodyWrapper.scrollLeft - 10;
|
bodyWrapper.scrollLeft = bodyWrapper.scrollLeft - 10;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
if (this.fit) {
|
if (this.fit) {
|
||||||
this.windowResizeListener = throttle(50, () => {
|
this.windowResizeListener = throttle(50, () => {
|
||||||
|
|
Loading…
Reference in New Issue