Socket
Socket
Sign inDemoInstall

better-scroll-list

Package Overview
Dependencies
4
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    better-scroll-list

A pull-up load and drop-down refresh data plugin


Version published
Weekly downloads
9
increased by50%
Maintainers
1
Install size
3.55 MB
Created
Weekly downloads
 

Readme

Source

better-scroll-list

A pull-up load and drop-down refresh data plugin

npm downloads

About better-scroll-list

Better-scroll-list encapsulates better-scroll pull-down and pull-up capabilities, and encapsulates some of its events and methods

install

Use npm for installation

  npm install --save better-scroll-list

Import using ES6

  import VueScroll from 'better-scroll-list'
  Vue.use(VueScroll)

Used as such in the component

  <vue-scroll></vue-scroll>

Supported parameters

parametertypedefaultdescription
scrollbarBooleantrueWhether to display the scroll bar
scrollbarFadeBooleantrueShow hidden scroll bar transition effect
pullDownRefreshBooleantrueWhether to initialize the pull-down refresh
pullDownRefreshThresholdNumber90Top pull-down distance
pullDownRefreshStopNumber40Refresh time and the distance to stay rebound
pullDownRefreshTxtString刷新成功Text displayed when refresh is successful
pullDownRefreshFailTxtString刷新失败Text displayed when refresh is failed
pullUpLoadBooleantrueWhether to initialize the pull-up load
pullUpLoadThresholdNumber0Bottom distance threshold
pullUpLoadMoreTxtString加载更多Text displayed when there is more data
pullUpLoadNoMoreTxtString没有更多了Text displayed when there is no more data
directionStringverticalThe default is vertical scrolling, if you want horizontal scrolling, you need to pass horizontal, but the horizontal scrolling temporarily does not support the pull-down refresh download
clickBooleanfalseWhen set to true, better-scroll will dispatch a click event, and we will add a private property to the dispatched event parameter, _constructed, to true
probeTypeNumber0Please refer to the better-scroll probeType
tapBooleanfalseBecause better-scroll prevents native click events, we can set tap to true, which dispatches a tap event when the zone is clicked, and you can listen to it as you would a native event
refreshDelayNumber20Data change refreshing scroll interval, in milliseconds
initMinHeightBooleantrueWhether to automatically add the minimum height of the scroll zone
listenScrollBooleanfalseWhether to listen for scroll events
listenBeforeScrollBooleanfalseWhether to listen beforeScrollStart event
listenScrollStartBooleanfalseWhether to listen for the scrollStart event
listenScrollEndBooleanfalseWhether to listen for the scrollEnd event
listenTouchEndBooleanfalseWhether to listen for the touchEnd event
listenFlickBooleanfalseWhether to listen for the flick event
listenRefreshBooleanfalseWhether to listen for the refresh event
listenDestroyBooleanfalseWhether to listen for the destroy event

Please refer to the detailed configuration better-scroll docs

Supported events

nameparameter
pulling-up-
pulling-down-
before-scroll-start-
scroll-startpos
scrollpos
scroll-endpos
touch-endpos
flick-
refresh-
destroy-
tap-
click-

Supported methods

namedescription
disabledisable scroll
enableenable scroll
refreshrefresh scroll area
destroydestroy scroll
scrollToinstance
scrollToElementSee the official document
rebuildSee the official document
forceUpdatecalled wehn pull-down refresh success and pull-up load success
errorUpdatecalled wehn pull-down refresh failed and pull-up load failed

Listen event case

  <vue-scroll ref="scroll" :listenScroll="listenScroll" @scroll="onScroll" @before-scroll-start="onBeforeScrollStart" :pulling-up="onPullingUp"></vue-scroll>
  export default {
    methods: {
      onBeforeScrollStart() {
        ...
      }
    }
  }

pass parameter case

  export default {
    created() {
      this.listenScroll = true
    },
    methods: {
      onBeforeScrollStart() {
        ...
      },
      onScroll(pos) {
        console.log(pos)
      }
    }
  }

Call the method example

  export default {
    methods: {
      onBeforeScrollStart() {
        ...
      },
      onPullingUp() {
        this.$refs.scroll.errorUpdate()
      }
    }
  }

Keywords

FAQs

Last updated on 14 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc