Welcome to h5-vue-scroller 👋
Homepage
🏠Install
npm i h5-vue-scrolleror yarn add h5-vue-scroller
Usage
Vue
<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>
Props
- preload-top:触发 top 的距离(px),默认
50
- preload-bottom:触发 bottom 的距离(px),默认
50
- throttle: 事件派发的频率,默认
0
不限流,如果设置为 < 0,则不派发事件 - tag:指定容器的元素,默认是
div
- event-step:事件触发的步长(px),大于这个步长才会 emit
top
和第一次的refresh
事件
Events
void
@top:滚动到屏幕顶部void
@bottom:滚动到屏幕底部object<{ offsetTop, isUp }>
@scroll 正在滚动object<{ offset, event }>
@refresh 下拉刷新void
@refresh-end:下拉刷新松手
Author
👤 falstack icesilt@outlook.com
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
License
This README was generated with ❤️ by readme-md-generator