update Scroll

This commit is contained in:
梁灏 2017-10-13 17:06:15 +08:00
parent c6487ddfc2
commit 9d275e38f1

View file

@ -117,7 +117,7 @@
let bottomLoaderHeight = 0; let bottomLoaderHeight = 0;
const container = this.$refs.scrollContainer; const container = this.$refs.scrollContainer;
const initialScrollTop = container.scrollTop; const initialScrollTop = container.scrollTop;
for (var i = 0; i < 20; i++) { for (let i = 0; i < 20; i++) {
setTimeout(() => { setTimeout(() => {
bottomLoaderHeight = Math.max( bottomLoaderHeight = Math.max(
bottomLoaderHeight, bottomLoaderHeight,
@ -262,7 +262,7 @@
}, },
created(){ created(){
this.handleScroll = throttle(this.onScroll, 150, {leading: false}); this.handleScroll = throttle(this.onScroll, 150, {leading: false});
this.pointerUpHandler = this.onPointerUp.bind(this), // because we need the same function to add and remove event handlers this.pointerUpHandler = this.onPointerUp.bind(this); // because we need the same function to add and remove event handlers
this.pointerMoveHandler = throttle(this.onPointerMove, 50, {leading: false}); this.pointerMoveHandler = throttle(this.onPointerMove, 50, {leading: false});
} }
}; };