扩展日常开发所需要的API,列入弹框,loading,ActionSheet等等。
npm install react-native-aplus --save
$ react-native link react-native-aplus
import{Platform,Button,StyleSheet,Text,View}from'react-native';importPlus,{Portal,Component}from'react-native-aplus';importReactfrom'react';// 在你的根组件中用 Portal组件, 如果是继承了 react-native-aplus 的component 则可以直接使用this.$$Plus.方法 来代替Plus.方法exportclassAppextendsComponent{render(){return(<View><Portal/></View>)}}// Toast组件Plus.showToast('hello toast')// orPlus.showToast({title:"hello",duration: Plus.Toast.DURATION.LONG,position: Plus.Toast.POSITION.CENTER})// Loading组件Plus.showLoading('数据加载中...');// orPlus.Loading.setIndicatorProps({// 设置loading的颜色color:'#f50',size:'large'});Plus.showLoading({title:'数据加载中...',theme: Plus.Loading.THEME.THEME3});// 使用主题三// actionsheetPlus.showActionSheet({title:'请选择',message:'请选择一种水果',itemList: ['香蕉','梨子','关闭'],success(tapIndex){// 点击之后的回调函数,数组的下标console.log(tapIndex)}});// 弹框Plus.showModal({title:"消息",message:'hello world',showCancel: true,showConfirm: true,textCancel: "关闭",textConfirm: "确认",onConfirm(){Plus.hideModal()}});- loading (完成)
- toast (完成)
- 对话框 (完成)
- ActionSheet (完成)
- FlatList (完成)
- ShareCard面板 (完成)
- 图片选择
- 图片预览
- 多列选择
- 三方登录
- 三方支付...