Skip to content

Commit

Permalink
Pull docs for load
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Sep 18, 2017
1 parent 216e494 commit 8647b7b
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions docs/zh-cn/components/Pull.md
Expand Up @@ -31,9 +31,9 @@ const LOAD_STATE = {
};
```

#### 基本用法
#### 下拉刷新

###### 下拉刷新
###### 基本
```jsx
<Pull
refreshing={this.state.refreshing}
Expand All @@ -47,7 +47,7 @@ const LOAD_STATE = {
</Pull>
```

###### 下拉刷新(自定义显示)
###### 自定义
```jsx
<Pull
refreshing={this.state.refreshing}
Expand Down Expand Up @@ -82,7 +82,9 @@ const LOAD_STATE = {
</Pull>
```

###### 上拉加载
#### 上拉加载

###### 基本
```jsx
<Pull
loading={this.state.loading}
Expand All @@ -96,6 +98,33 @@ const LOAD_STATE = {
</Pull>
```

###### 自定义
```jsx
<Pull
loading={this.state.loading}
loadRender={(loadState) => {
const cls = 'custom-control';
switch (loadState) {
case LOAD_STATE.loading:
return <div className={cls}><Spinner className="rotate360" /></div>;

case LOAD_STATE.failure:
return <div className={cls}>加载失败</div>;

case LOAD_STATE.complete:
return <div className={cls}>我是有底线的</div>;
}
}}
onLoad={() => {
this.setState({ loading: LOAD_STATE.loading });
setTimeout(() => {
this.setState({ loading: LOAD_STATE.success });
}, 2000);
}}>
foo
</Pull>
```

### API

| 属性 | 类型 | 默认值 | 可选值/参数 | 说明 |
Expand Down

0 comments on commit 8647b7b

Please sign in to comment.