描述: 滚动容器的下拉刷新功能
支持
仅WEEX
安装
$ npm install rax-refreshcontrol --save
引用
import RefreshControl from 'rax-refreshcontrol';
属性
注: 1、支持列表中的 代表h5 代表weex 代表小程序
属性 | 类型 | 默认值 | 必填 | 描述 | 支持 |
---|---|---|---|---|---|
refreshing | string |
- | false | 是否显示 | |
onRefresh | function |
- | false | 监听下拉刷新的行为 | |
onPullingdown | function |
- | false | 监听下拉事件 |
示例
import createElement Component render from 'rax';import View from 'rax-view';import Text from 'rax-text';import DU from 'driver-universal';import RecyclerView from 'rax-recyclerview';import RefreshControl from 'rax-refreshcontrol'; let { if arrayLike == null throw 'Object is null or undefined'; // Optional args. var mapFn = arguments1; var thisArg = arguments2; var C = this; var items = ; var symbolIterator = typeof Symbol === 'function' ? Symboliterator : '@@iterator'; var mapping = typeof mapFn === 'function'; var usingIterator = typeof itemssymbolIterator === 'function'; var key = 0; var ret; var value; if usingIterator ret = typeof C === 'function' ? : ; var it = itemssymbolIterator; var next; while !next = itdone value = nextvalue; if mapping value = mapFn; retkey = value; key += 1; retlength = key; return ret; var len = itemslength; if || len < 0 len = 0; ret = typeof C === 'function' ? len : len; while key < len value = itemskey; if mapping value = mapFn; retkey = value; key += 1; retlength = key; return ret;}; { thisprops; }; { return <View = > <View => <Text => thispropsdatatext + ' (' + thispropsdataclicks + ' clicks)' </Text> </View> </View> ; } state = isRefreshing: false loaded: 0 refreshText: '↓ Pull To Refresh' rowData: ; { rowclicks++; this; }; { this; ; }; { const rows = thisstaterowData; return <View => <RecyclerView => <RefreshControl = = = > <Text>thisstaterefreshText</Text> </RefreshControl> rows </RecyclerView> </View> ; } const styles = container: padding: 20 borderStyle: 'solid' borderColor: '#dddddd' borderWidth: 1 marginLeft: 20 marginRight: 20 marginBottom: 10 flex: 1 button: margin: 7 padding: 5 alignItems: 'center' backgroundColor: '#eaeaea' borderRadius: 3 box: width: 64 height: 64 eventLogBox: padding: 10 margin: 10 height: 80 borderWidth: 1 borderColor: '#f0f0f0' backgroundColor: '#f9f9f9' row: borderColor: 'grey' borderWidth: 1 padding: 20 margin: 5 text: alignSelf: 'center' color: 'black' refreshView: height: 80 width: 750 justifyContent: 'center' alignItems: 'center' refreshArrow: fontSize: 30 color: '#45b5f0' ; ;