1.0.4 • Published 6 years ago

vue-simple-scroll v1.0.4

Weekly downloads
25
License
9000
Repository
github
Last release
6 years ago

Vue Simple Scroll version vue

Vue Simple Scroll High-performance rolling Vue components, refresh and unlimited load.

Demo

https://github.com/machaosuper/vue-simple-scroll

or

# install dependencies
npm install

# serve with hot reload at localhost:9000
npm run dev

# build for production with minification
npm run build

How to use

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

Webpack project by vue-cli

https://github.com/machaosuper/vue-simply-scroll

API

vue-simple-scroll component attributes:

属性名相关描述类型默认值
onRefresh下拉刷新的回调函数Function-
onInfinite上拉加载更多的回调函数Function-
isRefreshText下拉刷新是否显示文字提示Booleantrue
noDataText上拉加载更多没有数据时显示String我是有底线的~~
infiniteLoadingText上拉加载更多加载中文字String加载中
offset内容区位于顶部的偏移量Number0
distance滑动距离底部多少开始加载Number0
refreshLayerColor下拉刷新图标和字的颜色String#ff6863
loadingLayerColor上拉加载更多图标和字的颜色String#ff6863

vue-simple-scroll vm instance methods:

  • scrollTop(y:Integer) 内容滚动到指定位置
  • getPosition() 获取当前滚动的距离
  • resetInfinite() 重置上拉加载更多当前状态
  • setInfiniteStatus(b:Boolean) 设置上拉加载更多当前状态, true:已经到最后一页,false:反之