# vue-super-scroller

> 基于vue 2.0 上下拉组件

Latest version **1.0.24** (published 2017-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-super-scroller
pnpm add vue-super-scroller
yarn add vue-super-scroller
bun add vue-super-scroller
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.24 |
| Published | 2017-01-11 |
| First published | 2017-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | walid |
| Maintainers | walid1992 |

## Links

- npm: https://www.npmjs.com/package/vue-super-scroller
- Repository: https://github.com/walid1992/vue-super-scroller
- Homepage: https://github.com/walid1992/vue-super-scroller#readme
- Issues: https://github.com/walid1992/vue-super-scroller/issues
- npm.io page: https://npm.io/package/vue-super-scroller

## Recent versions

- 1.0.24 (latest) — 2017-01-11
- 1.0.23 — 2017-01-11
- 1.0.22 — 2017-01-11
- 1.0.21 — 2017-01-11
- 1.0.20 — 2017-01-11
- 1.0.19 — 2017-01-10
- 1.0.18 — 2017-01-10
- 1.0.16 — 2017-01-10
- 1.0.15 — 2017-01-10
- 1.0.13 — 2017-01-10
- 1.0.12 — 2017-01-10
- 1.0.11 — 2017-01-10
- 1.0.10 — 2017-01-07
- 1.0.9 — 2017-01-07
- 1.0.8 — 2017-01-07
- … 8 more at https://npm.io/package/vue-super-scroller/versions

## README

# vue-super-scroller

[![npm](https://img.shields.io/npm/v/vue-super-scroller.svg) ![npm](https://img.shields.io/npm/dm/vue-super-scroller.svg)](https://www.npmjs.com/package/vue-super-scroller)
[![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)

## Table of contents

- [Installation](#installation)
- [Usage](#usage)
- [Example](#example)

# Installation

```
npm install vue-super-scroller --save
```

## Global Install

Install all the components:

```javascript
import Vue from 'vue'
import VueSuperScroller from 'vue-super-scroller'

Vue.use(VueSuperScroller)
```

# Usage

:load-disabled="!hasNext"

:on-refresh="refresh"

:on-load='loadMore'

# Example

```
<template>
  <div id="app">
    <vue-scroller :load-disabled="!hasNext" :on-refresh="refresh" :on-load='loadMore'>
      <li v-for="(item,index) in lists">{{item}}</li>
    </vue-scroller>
  </div>
</template>

<script>
  export default {
    name: 'app',
    components: {},
    data () {
      return {
        lists: [1, 2, 3],
        hasNext: true
      }
    },
    mounted () {
      this.$nextTick(function () {
        this.loadMore()
      })
    },
    methods: {
      getRandArr (num = 20) {
        let arr = []
        for (let i = num - 1; i >= 0; i--) {
          arr.push(Math.round(Math.random() * 100))
        }
        return arr
      },

      refresh (call) {
        setTimeout(() => {
          this.lists = [1, 2, 3]
          call(true)
        }, 1000)
      },

      loadMore () {
        setTimeout(() => {
          this.lists = this.lists.concat(this.getRandArr(20))
          if (this.lists.length > 50) {
            this.hasNext = false
          }
        }, 1000)
      }
    }
  }
</script>

<style>
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin-top: 60px;
  }

  li {
    height: 150px;
    text-align: center;
    line-height: 150px;
    font-size: 30px;
  }

  li:nth-child(odd) {
    background-color: #eee
  }
</style>
```

---

## License

[MIT](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/vue-super-scroller · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
