Skip to content

Commit da902a9

Browse files
committed
remove: bottom event throttle
1 parent eadd69c commit da902a9

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Vue.component(VScroller.name, VScroller)
4343
2. preload-bottom:触发 bottom 的距离(px),默认`50`
4444
3. throttle: 事件派发的频率,默认`0`不限流,如果设置为 < 0,则不派发事件
4545
4. tag:指定容器的元素,默认是`div`
46-
5. event-step:事件触发的步长(px),大于这个步长才会 emit`top``bottom`, *第一次*`refresh` 事件
46+
5. event-step:事件触发的步长(px),大于这个步长才会 emit`top`, *第一次*`refresh` 事件
4747

4848
## Events
4949
1. `void` @scroll-down:正在向下滚动

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "h5-vue-scroller",
3-
"version": "0.1.21",
3+
"version": "0.1.22",
44
"main": "dist/h5-vue-scroller.umd.min.js",
55
"files": [
66
"dist"

src/scroller.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default {
4545
events['&scroll'] = this.handleScroll
4646
}
4747
events['&touchstart'] = this.handleStart
48-
events['touchmove'] = this.handleMove
48+
events['&touchmove'] = this.handleMove
4949
events['&touchend'] = this.handleEnd
5050
}
5151
return h(
@@ -99,10 +99,7 @@ export default {
9999
if (scrollTop > 0) {
100100
this.$emit('scroll-down')
101101
}
102-
if (
103-
$el.scrollHeight - $el.clientHeight - scrollTop <= preloadBottom &&
104-
delta + eventStep <= 0
105-
) {
102+
if ($el.scrollHeight - $el.clientHeight - scrollTop <= preloadBottom) {
106103
this.$emit('bottom')
107104
}
108105
}

0 commit comments

Comments
 (0)