# Pager 滚动分页组件

---

Pager 组件，提供列表页滚动翻页功能。

## 使用指南

在 Taro 文件中引入组件

:::demo

```js
import Taro, { Component, Config } from "@tarojs/taro";
import { View, Text, ScrollView } from "@tarojs/components";
import { AtActivityIndicator } from 'taro-ui';

import Pager from "taro-tools-ui";
import "./index.scss";

class Index extends Component<IndexProps, IndexState> {
  config: Config = {
    navigationBarTitleText: 'index',
    disableScroll: true,
  }

  state = {
    current: 1,
    total: 200,
  };

  onPullDown() {
    console.log('pulldown');
  }


  render() {
    const { current, total } = this.state;
    return (
      <Pager
      onChange={ /** 请求数据 */}
      current={current}
      total={total}
       >
        <View>
          测试列表内容
          测试列表内容
          测试列表内容
          测试列表内容
          测试列表内容
          测试列表内容
          测试列表内容
          测试列表内容
          测试列表内容
        </View>
      </Pager>
    );
  }
}
```

## 一般用法

说明：

- 该组件为高阶组件，基于ScrollView，实现了分页管理。

:::demo

```js

```

:::

## 参数

| 参数        | 说明                       | 类型        | 可选值 | 默认值 |
| ----------- | ------------------------- | -----------| ------| ------ |
| onChange     | 页码变更回调函数            | Function   | 可选   | -      |
| current     | 当前页码                    | Int        | 必选   | -      |
| total       | 总页码                     | Int         | 必选   | -      |
| page_size   | 分页容量                   | Int   | 可选   | -      |

## 事件

| 事件名称 | 说明                 | 返回参数 |
| -------- | -------------------- | -------- |
