🏠 Homepage
npm i h5-vue-scroller or yarn add h5-vue-scrollerimport 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>- preload-top:触发 top 的距离(px),默认
50 - preload-bottom:触发 bottom 的距离(px),默认
50 - throttle: 事件派发的频率,默认
0不限流,如果设置为 < 0,则不派发事件 - tag:指定容器的元素,默认是
div - event-step:事件触发的步长(px),大于这个步长才会 emit
top和第一次的refresh事件
void@top:滚动到屏幕顶部void@bottom:滚动到屏幕底部object<{ offsetTop, isUp }>@scroll 正在滚动object<{ offset, event }>@refresh 下拉刷新void@refresh-end:下拉刷新松手
👤 falstack icesilt@outlook.com
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