• Stars
    star
    1,789
  • Rank 25,982 (Top 0.6 %)
  • Language
    JavaScript
  • Created about 8 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scroller Component for Vue.js

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. Name Description Required Default Value
onRefresh pull to refresh callback N -
onInfinite infinite loading callback N -
refreshText tips of pull-to-refresh N 下拉刷新
noDataText tips of no-more-data when infinite-loading finished N 没有更多数据
width scroller container width N 100%
height scroller container height N 100%
snapping enable snapping mode N false
snappingWidth snapping width N 100 (stand for 100px)
snappingHeight snapping height N 100
refreshLayerColor text color of pull-to-refresh layer N #AAA
loadingLayerColor text color of infinite-loading layer N #AAA
minContentHeight min content height (px) of scroll-content N 0

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

More Repositories

1

vonic

Mobile UI Components, based on Vue.js and ionic CSS. https://wangdahoo.github.io/vonic-documents
Vue
3,397
star
2

vue-progress

https://wangdahoo.github.io/vue-progress
JavaScript
161
star
3

vue-animate-number

animate-number as a vue component.
HTML
107
star
4

vswipe

A Vue Swipe Component.
JavaScript
93
star
5

vonic-webpack-starter

A vonic starter with webpack template by vue-cli.
JavaScript
64
star
6

flask-element-starter

A python project starter equipped with flask and element-ui.
Vue
40
star
7

vue-scroller-demo

Vue
25
star
8

vonic-documents

vonic 2.0 documents site https://wangdahoo.github.io/vonic-documents
CSS
24
star
9

vonic-template

Webpack Template for Vonic.
JavaScript
13
star
10

simple-react-starter

CSS
11
star
11

JSBridge

Android WebView JavaScript Bridge. Inspired by marcuswestin's WebViewJavascriptBridge https://github.com/marcuswestin/WebViewJavascriptBridge
Java
11
star
12

virtual-dom

yet anthor virtual-dom.
JavaScript
5
star
13

map-state-vmodel

mapState for v-model
JavaScript
4
star
14

koa-rest-boilerplate

Koa restful boilerplate in typescript
TypeScript
4
star
15

list-diff

TypeScript
3
star
16

ionic-css

Ionic css components standalone.
CSS
3
star
17

redis-sharding

redis sharding via HashRing
JavaScript
3
star
18

gowork

Setup vscode golang development envionment quickly.
JavaScript
2
star
19

AbsoluteAdmin

HTML
2
star
20

vonic-webpack-code-splitting

vonic webpack code-splitting example
JavaScript
2
star
21

deque

double-ended queue.
JavaScript
1
star
22

wangdahoo.keys

1
star
23

von-app

Vue
1
star
24

script-error

JavaScript
1
star
25

create-element-app

1
star
26

vonic-doc

Deprecated. Please refer to https://github.com/wangdahoo/vonic-documents.
JavaScript
1
star
27

ngScroll

Scroller Component for Angular.js 1.x https://wangdahoo.github.io/ngScroll
JavaScript
1
star
28

ionic-sass

CSS
1
star
29

serve-https

JavaScript
1
star
30

swiper

JavaScript
1
star
31

zui

ZUI Framework
JavaScript
1
star
32

create-my-app

A simple project generator cli.
JavaScript
1
star
33

weui-less

CSS
1
star