inspired by iNoBounce, stop your iOS webapp from bouncing around when scrolling and more.
npm i h5-vue-scroller
or
yarn add h5-vue-scroller
import Vue from 'vue'
import VScroller from 'h5-vue-scroller'
Vue.component(VScroller.name, VScroller)
<v-scroller
tag="ul"
:preload-top="50"
:preload-bottom="50"
:throttle="0"
:event-step="1"
@top="handleScrollTop"
@bottom="handleLoadMore"
@refresh="handleRefresh({ offset, event })"
@refresh-end="handleRefreshEnd"
@scroll="handleScroll({ offsetTop, isUp })"
>
<slot/>
</v-scroller>
50
50
0
不限流,如果设置为 < 0,则不派发事件div
top
和第一次的refresh
事件void
@top:滚动到屏幕顶部void
@bottom:滚动到屏幕底部object<{ offsetTop, isUp }>
@scroll 正在滚动object<{ offset, event }>
@refresh 下拉刷新void
@refresh-end:下拉刷新松手👤 falstack [email protected]
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator