Skip to content

Commit eadd69c

Browse files
committed
update: refersh event-step
1 parent 9012d30 commit eadd69c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
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` 事件
46+
5. event-step:事件触发的步长(px),大于这个步长才会 emit`top``bottom`, *第一次*`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.20",
3+
"version": "0.1.21",
44
"main": "dist/h5-vue-scroller.umd.min.js",
55
"files": [
66
"dist"

src/scroller.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export default {
7070
const currentY = event.touches[0].clientY
7171
const offset = currentY - this.lastTouchY
7272
if (offset > 0 && this.lastScrollTop <= 0) {
73+
if (!this.refreshing && offset < this.eventStep) {
74+
return
75+
}
7376
this.refreshing = true
7477
this.$emit('refresh', { event, offset })
7578
}

0 commit comments

Comments
 (0)