best-scroll
v1.0.6
Published
史上最好的滚动插件 on Vue.js
Downloads
38
Readme
Best Scroll
How to use
NPM
npm i best-scroll -S
js
import Vue from 'vue'
import scroll from 'best-scroll'
Vue.use(scroll)
vue
<scroll
:on-refresh="refresh"
:on-infinite="infinite">
<!-- content goes here -->
</scroll>
API
Scroll component attributes:
| Attr. Name | Description | Required | Default Value |
|-----|-----|-----|-----|
| onRefresh | pull to refresh callback | N | - |
| onInfinite | infinite loading callback | N | - |
| onScroll | Y-axis position callback | N | - |
| scrollingComplete | scroll end callback | N | 滚动完毕回调 |
| width | scroll container width | N | 100%
|
| height | scroll container height | N | 100%
|
Scroll vm instance methods:
resize()
resize scroll content (deprecated, cause the scroll's content resizes self automatically)triggerPullToRefresh()
start pull-to-refresh manuallyfinishPullToRefresh()
stop pull-to-refreshfinishInfinite(isNoMoreData :Boolean)
stop infinite-loadingscrollTo(x:Integer, y:Integer, animate:Boolean)
scroll to a position in scroll contentscrollBy(x:Integer, y:Integer, animate:Boolean)
scroll by a position in scroll contentgetPosition :Object
get current position of scroll contentscrollElement(el, time, offsetX, offsetY, easing)
disable()
disable scrollingenable()
enable scrolling