1.0.4 • Published 7 years ago

vue-cool-scroller v1.0.4

Weekly downloads
22
License
-
Repository
github
Last release
7 years ago

Vue Scroller version vue

Vue Scroller is a foundational component of Vonic UI. In purpose of smooth scrolling, pull to refresh and infinite loading.

For vue 1.0, please refer to branch v1.

Demo

How to use

<div id="app">
  <scroller 
    :on-refresh="refresh"
    :on-infinite="infinite"
    ref="my_scroller">
    <!-- content goes here -->
  </scroller>
</div>

Live Code

Webpack project by vue-cli

https://github.com/wangdahoo/vue-scroller-demo

API

Scroller instance methods:

  • resize() resize scroller content
  • triggerPullToRefresh() start pull-to-refresh manually
  • finishPullToRefresh() stop pull-to-refresh
  • finishInfinite(isNoMoreData :Boolean) stop infinite-loading
  • scrollTo(x:Integer, y:Integer, animate:Boolean) scroll to a position in scroller content
  • scrollBy(x:Integer, y:Integer, animate:Boolean) scroll by a position in scroller content
  • getPosition :Object get current position of scroller content