1 | # rmc-pull-to-refresh
|
2 | ---
|
3 |
|
4 | React Mobile PullToRefresh Component.
|
5 |
|
6 |
|
7 | [![NPM version][npm-image]][npm-url]
|
8 | [![build status][travis-image]][travis-url]
|
9 | [![Test coverage][coveralls-image]][coveralls-url]
|
10 | [![gemnasium deps][gemnasium-image]][gemnasium-url]
|
11 | [![npm download][download-image]][download-url]
|
12 |
|
13 | [npm-image]: http://img.shields.io/npm/v/rmc-pull-to-refresh.svg?style=flat-square
|
14 | [npm-url]: http://npmjs.org/package/rmc-pull-to-refresh
|
15 | [travis-image]: https://img.shields.io/travis/react-component/m-pull-to-refresh.svg?style=flat-square
|
16 | [travis-url]: https://travis-ci.org/react-component/m-pull-to-refresh
|
17 | [coveralls-image]: https://img.shields.io/coveralls/react-component/m-pull-to-refresh.svg?style=flat-square
|
18 | [coveralls-url]: https://coveralls.io/r/react-component/m-pull-to-refresh?branch=master
|
19 | [gemnasium-image]: http://img.shields.io/gemnasium/react-component/m-pull-to-refresh.svg?style=flat-square
|
20 | [gemnasium-url]: https://gemnasium.com/react-component/m-pull-to-refresh
|
21 | [node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
|
22 | [node-url]: http://nodejs.org/download/
|
23 | [download-image]: https://img.shields.io/npm/dm/rmc-pull-to-refresh.svg?style=flat-square
|
24 | [download-url]: https://npmjs.org/package/rmc-pull-to-refresh
|
25 |
|
26 |
|
27 | ## Screenshots
|
28 |
|
29 | <img src="https://os.alipayobjects.com/rmsportal/rcLuiqtnDULPyzG.gif" width="288"/>
|
30 |
|
31 |
|
32 | ## Development
|
33 |
|
34 | ```
|
35 | npm install
|
36 | npm start
|
37 | ```
|
38 |
|
39 | ## Example
|
40 |
|
41 | http://localhost:8899/examples/
|
42 |
|
43 | online example: http://react-component.github.io/m-pull-to-refresh/
|
44 |
|
45 |
|
46 | ## install
|
47 |
|
48 | [![rmc-pull-to-refresh](https://nodei.co/npm/rmc-pull-to-refresh.png)](https://npmjs.org/package/rmc-pull-to-refresh)
|
49 |
|
50 |
|
51 | ## Usage
|
52 |
|
53 | see example
|
54 |
|
55 | ## API
|
56 |
|
57 | ### props
|
58 |
|
59 | | name | description | type | default |
|
60 | |----------|----------------|----------|--------------|
|
61 | | direction | pull direction, can be `up` or `down` | String | `down` |
|
62 | | distanceToRefresh | distance to pull to refresh | number | 50 |
|
63 | | refreshing | Whether the view should be indicating an active refresh | bool | false |
|
64 | | onRefresh | Called when the view starts refreshing. | () => void | - |
|
65 | | indicator | indicator config | Object | `{ activate: 'release', deactivate: 'pull', release: 'loading', finish: 'finish' }` |
|
66 | | className | additional css class of root dom node | String | - |
|
67 | | prefixCls | prefix class | String | 'rmc-pull-to-refresh' |
|
68 | | damping | pull damping, suggest less than 200 | number | 100 |
|
69 | | scale | damping scale | number | 0.6 |
|
70 |
|
71 | ## Test Case
|
72 |
|
73 | ```
|
74 | npm test
|
75 | ```
|
76 |
|
77 | ## Coverage
|
78 |
|
79 | ```
|
80 | npm run coverage
|
81 | ```
|
82 |
|
83 | ## License
|
84 |
|
85 | rmc-pull-to-refresh is released under the MIT license.
|