2.2.4 • Published 7 years ago

vue-scroller v2.2.4

Weekly downloads
765
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

https://wangdahoo.github.io/vue-scroller/

How to use

npm i vue-scroller -S
/* ignore this if you include vue-scroller.js by <script> tag from a cdn, such as unpkg */
import Vue from 'vue'
import VueScroller from 'vue-scroller'
Vue.use(VueScroller)
<scroller 
  :on-refresh="refresh"
  :on-infinite="infinite">
  <!-- content goes here -->
</scroller>

Live Code on JsFiddle

Webpack project by vue-cli

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

API

Scroller component attributes:

Attr. NameDescriptionRequiredDefault Value
onRefreshpull to refresh callbackN-
onInfiniteinfinite loading callbackN-
onInfiniteinfinite loading callbackN-
refreshTexttips of pull-to-refreshN下拉刷新
noDataTexttips of no-more-data when infinite-loading finishedN没有更多数据
widthscroller container widthN100%
heightscroller container heightN100%
snappingenable snapping modeNfalse
snappingWidthsnapping widthN100 (stand for 100px)
snappingHeightsnapping heightN100
refreshLayerColortext color of pull-to-refresh layerN#AAA
loadingLayerColortext color of infinite-loading layerN#AAA
minContentHeightmin content height (px) of scroll-contentN0

Scroller vm instance methods:

  • resize() resize scroller content (deprecated, cause the scroller'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 scroller content
  • scrollBy(x:Integer, y:Integer, animate:Boolean) scroll by a position in scroller content
  • getPosition :Object get current position of scroller content
2.2.4

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.1-beta.2

7 years ago

2.2.1-beta.1

7 years ago

2.2.0

7 years ago

2.2.0-beta.1

7 years ago

2.2.0-alpha.3

7 years ago

2.2.0-alpha.2

7 years ago

2.2.0-alpha.1

7 years ago

2.1.3-alpha.3

7 years ago

2.1.3-alpha.2

7 years ago

2.1.3-alpha.1

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

0.4.0

7 years ago

2.0.0

7 years ago

0.3.9

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago