npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

better-scroll-list

v0.5.8

Published

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

Downloads

2

Readme

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

|parameter|type|default|description| |:-:|:-:|:-:|:-:| |scrollbar|Boolean|true|Whether to display the scroll bar| |scrollbarFade|Boolean|true|Show hidden scroll bar transition effect| |pullDownRefresh|Boolean|true|Whether to initialize the pull-down refresh| |pullDownRefreshThreshold|Number|90|Top pull-down distance| |pullDownRefreshStop|Number|40|Refresh time and the distance to stay rebound| |pullDownRefreshTxt|String|刷新成功|Text displayed when refresh is successful| |pullDownRefreshFailTxt|String|刷新失败|Text displayed when refresh is failed| |pullUpLoad|Boolean|true|Whether to initialize the pull-up load| |pullUpLoadThreshold|Number|0|Bottom distance threshold| |pullUpLoadMoreTxt|String|加载更多|Text displayed when there is more data| |pullUpLoadNoMoreTxt|String|没有更多了|Text displayed when there is no more data| |direction|String|vertical|The 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| |click|Boolean|false|When 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| |probeType|Number|0|Please refer to the better-scroll probeType |tap|Boolean|false|Because 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| |refreshDelay|Number|20|Data change refreshing scroll interval, in milliseconds| |initMinHeight|Boolean|true|Whether to automatically add the minimum height of the scroll zone| |listenScroll|Boolean|false|Whether to listen for scroll events| |listenBeforeScroll|Boolean|false|Whether to listen beforeScrollStart event| |listenScrollStart|Boolean|false|Whether to listen for the scrollStart event| |listenScrollEnd|Boolean|false|Whether to listen for the scrollEnd event| |listenTouchEnd|Boolean|false|Whether to listen for the touchEnd event| |listenFlick|Boolean|false|Whether to listen for the flick event| |listenRefresh|Boolean|false|Whether to listen for the refresh event| |listenDestroy|Boolean|false|Whether to listen for the destroy event|

Please refer to the detailed configuration better-scroll docs

Supported events

|name|parameter| |:-:|:-:| |pulling-up|-| |pulling-down|-| |before-scroll-start|-| |scroll-start|pos| |scroll|pos| |scroll-end|pos| |touch-end|pos| |flick|-| |refresh|-| |destroy|-| |tap|-| |click|-|

Supported methods

|name|description| |:-:|:-:| |disable|disable scroll| |enable|enable scroll| |refresh|refresh scroll area| |destroy|destroy scroll | |scrollTo|instance| |scrollToElement|See the official document| |rebuild|See the official document| |forceUpdate|called wehn pull-down refresh success and pull-up load success| |errorUpdate|called 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()
      }
    }
  }