Giter Club home page Giter Club logo

better-scroll's Introduction

better-scroll

安装

npm i -D better-scroll

引入

import BScroll from 'better-scroll'

常用参数

pullUpLoad

类型:Boolean | Object

默认值:false (不开启 上拉加载更多 功能)

// 启用 上拉加载更多 配置
pullUpLoad: {
	threshold: 50
}
pullDownRefresh

类型:Boolean | Object

默认值:false (不开启 下拉刷新 功能)

// 启用 下拉刷新 配置
pullDownRefresh: {
	threshold: 50,
	stop: 20
}

常用方法

refresh()

参数: 无

返回值: 无

作用:重新计算 better-scroll, 当 DOM 结构发生变化的时候务必要调用确保滚动的效果正常

finishPullDown()

参数: 无

返回值: 无

作用: 当下拉刷新数据加载完毕后,需要调用此方法告诉 better-scroll 数据已加载

finishPullUp()

参数:无

返回值: 无

作用: 当上拉加载数据加载完毕后,需要调用此方法告诉 better-scroll 数据已加载

常用事件

pullingDown

参数:无

触发时机:在一次下拉刷新的动作后,这个时间一般去后台请求数据

pullingUp

参数: 无

触发时机:在一次上拉加载的动作后,这个时间一般去后台请求数据

---来源: http://ustbhuangyi.github.io/better-scroll/doc/zh-hans/events.html

better-scroll's People

Contributors

winfrise avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.