2.3.12 • Published 5 years ago

nuke-refresh-control v2.3.12

Weekly downloads
109
License
Apache-2.0
Repository
gitlab
Last release
5 years ago

RefreshControl

  • category: Components
  • chinese: 含 h5 版本的下拉刷新组件
  • type: Basic

Design

RefreshControl is a sub component that can pull down and refresh, and the parent component can only be <Scrollview> or <ListView>.

In use, it can be directly used as a container, corresponding to the internal rendering logic.

// Please refer to the ScrollView Component Demo

//初始 state
constructor() {
    super();
    this.state={
        isRefreshing: false,
        refreshText: '↓ 下拉刷新',
        data:[
            //...Omit part of the code
        ]
    }
}

handleRefresh =()=>{
    this.setState({
        isRefreshing: true,
        refreshText: '加载中',
    });
    //mock ajax 此处替换为你的 ajax 请求
    setTimeout(() => {
        this.setState({
            isRefreshing: false,
            data: [
                // data 字段变更
            ],
            refreshText: '↓ 下拉刷新',
        });

    }, 1000);
}
render(){
    return(
        <ScrollView>
            <RefreshControl isRefreshing={this.state.isRefreshing} style={{width:750,height:100}} onRefresh={this.handleRefresh}>
                <Text>{this.state.refreshText}</Text>
            </RefreshControl>
            {/* Content */}
        <ScrollView>
    )
}

API

ArgumentDescriptionTypeDefault
isRefreshingshow, or notfalse
onRefreshrefresh eventFunction
stylestyle must be declared wide, otherwise it may not be displayedobject

The Other

  • Chat with @翊晨[yichen] in Dingtalk desktop App Download
  • DingTalk Group
2.3.12

5 years ago

2.3.11

5 years ago

2.3.10

5 years ago

2.3.9

5 years ago

2.3.8

5 years ago

2.3.7

5 years ago

2.3.6

5 years ago

2.3.5

5 years ago

2.3.4

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.0

5 years ago

0.0.7

6 years ago

2.2.29

6 years ago

2.2.28

6 years ago

2.2.26

6 years ago

2.2.24

6 years ago

2.2.23

6 years ago

2.2.21

6 years ago

2.2.19

6 years ago

2.2.18

6 years ago

2.2.17

6 years ago

2.2.16

6 years ago

2.2.14

6 years ago

2.2.13

6 years ago

2.2.11

6 years ago

2.2.10

6 years ago

2.2.8

6 years ago

2.2.7

6 years ago

2.2.6

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.1.10

6 years ago

2.1.6

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.1-4.3

6 years ago

2.1.1-4.2

6 years ago

2.1.1-3

6 years ago

1.0.3

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago