Skip to content

varjay/best-scroll

Repository files navigation

Best Scroll version vue

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 manually
  • finishPullToRefresh() stop pull-to-refresh
  • finishInfinite(isNoMoreData :Boolean) stop infinite-loading
  • scrollTo(x:Integer, y:Integer, animate:Boolean) scroll to a position in scroll content
  • scrollBy(x:Integer, y:Integer, animate:Boolean) scroll by a position in scroll content
  • getPosition :Object get current position of scroll content
  • scrollElement(el, time, offsetX, offsetY, easing)
  • disable() disable scrolling
  • enable() enable scrolling

About

有史以来最好的滚动插件 for vue.js2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published