# @iwux/refresher-scroll

> { "usingComponents": { "wux-refresher-scroll": "@iwux/refresher-scroll" } }

Latest version **1.0.83** (published 2021-04-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install @iwux/refresher-scroll
pnpm add @iwux/refresher-scroll
yarn add @iwux/refresher-scroll
bun add @iwux/refresher-scroll
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.83 |
| Published | 2021-04-26 |
| First published | 2021-04-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 35.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tianyingchun |

## Links

- npm: https://www.npmjs.com/package/@iwux/refresher-scroll
- npm.io page: https://npm.io/package/@iwux/refresher-scroll

## Dependencies (1)

- [@iwux/helpers](https://npm.io/package/@iwux/helpers.md) ^1.0.83

## Recent versions

- 1.0.83 (latest) — 2021-04-26

## README

# usage

<!-- .json -->
{
  "usingComponents": {
    "wux-refresher-scroll": "@iwux/refresher-scroll"
  }
}

<!-- .js -->
Page({
  data: {
    items: [],
    scrollTop: 0,
  },
  onLoad() {
    this.setData({
      onRequestItems: this.onRequestItems.bind(this),
    });
  },
  onRequestItems({ page, pageSize, firstRequest }) {
    return indexService.requestMock({ page, pageSize }).then(({ data }: any) => {
      const items = data;
      const newItems = page === 1 ? items : this.data.items.concat(items);
      this.setData({ items: newItems }, () => {
        if (firstRequest) {
          $spinner().hide();
        }
      });
      return items;
    }).catch(err => {
      wx.showToast({ title: err.message || '请求数据异常', icon: 'none' });
    });
  },
  onPageScroll(e) {
    this.setData({
      scrollTop: e.scrollTop,
    });
  },
});

<!-- .wxml -->
<wux-refresher-scroll height="{{}}" onRequestItems="{{onRequestItems}}" catchTouch="{{true}}">
  <view class="oh">
    <block wx:for="{{ items }}" wx:key="index">
      <image src="https://file.40017.cn/jinfu/venus_doc/doc/assets/paragraph.png" />
    </block>
  </view>
</wux-refresher-scroll>

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