# neumedia-infinite-scroll

> 通过上下拖拽的操作，重新刷新页面数据，或加载更多列表数据。

Latest version **1.2.0** (published 2020-12-07) · 0 weekly downloads

## Install

```sh
npm install neumedia-infinite-scroll
pnpm add neumedia-infinite-scroll
yarn add neumedia-infinite-scroll
bun add neumedia-infinite-scroll
```

## 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.2.0 |
| Published | 2020-12-07 |
| First published | 2020-08-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 26.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | hliang-321 |

## Links

- npm: https://www.npmjs.com/package/neumedia-infinite-scroll
- npm.io page: https://npm.io/package/neumedia-infinite-scroll

## Dependencies (4)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [vant](https://npm.io/package/vant.md) ^2.10.2
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [vue-infinite-loading](https://npm.io/package/vue-infinite-loading.md) ^2.4.5

## Recent versions

- 1.2.0 (latest) — 2020-12-07
- 1.1.5 — 2020-11-17
- 1.1.4 — 2020-11-17
- 1.1.3 — 2020-11-17
- 1.1.2 — 2020-11-17
- 1.1.1 — 2020-11-17
- 1.1.0 — 2020-09-16
- 1.0.0 — 2020-08-18

## README

# 拖拽刷新/加载更多

通过上下拖拽的操作，重新刷新页面数据，或加载更多列表数据。



## 更新历史

| 版本号 | 作者                    | 更新记录 | 更新时间   |
| ------ | ----------------------- | -------- | ---------- |
| 1.0.0  | huang.liang@neusoft.com | 初始版本 | 2020.08.03 |
|        |                         |          |            |



 ## 安装

```shell
npm install neumedia-infinite-scroll
```



## 导入

```javascript
import InfiniteScroll from 'neumedia-infinite-scroll';

export default {
    components: {
        InfiniteScroll
    },
    data() {
        return {
            page: 1,
            list: [],
            incr: []
        };
    },
    methods: {
        getList(page) {
            // 获取第 page 页数据
            this.
        },
        handleRefresh() {
            this.page = 1;
            this.getList(this.page);
        },
        handleLoadPage() {
            let list = this.getList(this.page);
            this.page = this.page + 1;
            return list;
        }
    }
}
```



## 使用

```html
<infinite-scroll v-model="list" :update="update" :handle-more="handleLoadPage" :handle-refresh="handleRefresh"></infinite-scroll>
```



## API

### Props

| 说明           | 说明                                 | 类型     | 默认值        |
| -------------- | ------------------------------------ | -------- | ------------- |
| value(v-model) | 列表内容                             | Array    | []            |
| handle-more    | 注册上拉加载数据方法（返回单页数据） | Function | function() {} |
| handle-refresh | 注册下拉刷新数据方法（返回单页数据） | Function | function() {} |



### Slots

| 名称       | 说明                     |
| ---------- | ------------------------ |
| no-more    | 没有更多内容时的显示文字 |
| no-results | 没有内容时的显示文字     |

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