uat-lifetime

1.0.13 • Public • Published

使用说明

安装依赖

- npm install --save react-native-image-zoom-viewer
- npm install --save uat-image-browser
- npm install --save react-native-video[具体步骤](https://github.com/react-native-community/react-native-video#ios-installation)
- npm install --save react-native-uat-alert

使用

```
render(){
	const {style} = this.props;
		const {
				refreshing,
				loading,
				data,
			} = this.state;
			return <UatLifetime data={data} 
													style={styles.container}
													refreshing={refreshing}
													loading={loading}
													onRefresh={this.refreshData}
													onEndReached={this.loadMoreData}
													onPraise={this.onPraise}
													ref={ref=>this.lifetime=ref}
													onSendComment={this.onComment}
													supportReply={false}
													onDelComment={this.onDelComment}
											/>
}
几个重要属性
外部维护数据
当数据发生变化时,直接修改data就可以
```

属性Props说明

属性 类型 说明
style ViewStyle 容器样式
loading boolean 是否正在加载更多
data Msg[] 列表显示的数据源
err ?string 错误内容,空表示请求成功
firstLoadingView React.Element 首次数据加载样式 (废弃)
onDelComment (comment:Comment,msg:Msg)=>{} 删除评论
supportReply boolean 是否支持回复,如果禁用,则用户无法通过点击评论回复别人
onPraise (msg:Msg)=>{} 点赞,取消点赞,根据selfHasPraise判断是取消还是点赞
onSendComment (content:String,comment:?Comment,msg:Msg)=>{} 点击发送评论
onLoad ()=>{} 滚动到底部加载更多
onRefresh ()=>{} 下拉刷新

外部方法说明

Readme

Keywords

Package Sidebar

Install

npm i uat-lifetime

Weekly Downloads

0

Version

1.0.13

License

ISC

Unpacked Size

54.6 kB

Total Files

17

Last publish

Collaborators

  • badmaker