1.0.10 • Published 2 years ago

react-native-public-component v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

React Native万能公用组件 最新版本1.0.10

联系人:刘成,QQ&微信:674668211 项目中总是会用到很多公共的组件,样式就跟设置里面的单个item很像,本项目就是打造一个公共的万能组件 项目中有两个文件,一个是公用组件,一个是字体大小适配

简书具体使用说明:https://www.jianshu.com/p/941189bd7bb0 示例

npm install --save react-native-public-component

项目中导入

import {PublicCompoennt, dimens} from 'react-native-public-component'

参数说明

props说明备注
containerStyle整个容器的样式,可以设置padding、margin、背景颜色等等
leftComponent自定义左侧组件
centerContent自定义中间组件
rightComponent自定义右侧组件
leftComponentStyle自定义左侧组件样式
centerContentStyle自定义中间组件样式
rightComponentStyle自定义右侧组件样式
leftIcon左侧图标
leftIconStyle左侧图标样式
rightIcon右侧图标
rightIconStyle右侧图标样式
rightArrow右侧箭头
rightArrowStyle右侧箭头样式
isRightArrowShow是否显示右侧箭头默认显示 true
leftText左侧文字可以为字符串或者Text组件
leftTextStyle左侧文字样式
centerText中间文字可以为字符串或者Text组件
centerTextStyle中间文字样式
rightText右侧文字可以为字符串或者Text组件
rightTextStyle右侧文字样式
onPress整个item的点击事件方法
onLeftPress左侧点击事件方法
onRightPress右侧点击事件方法
onCenterPress中间点击事件方法
hiddenLeft隐藏左侧bool,默认为false
hiddenRight隐藏右侧bool,默认为false
removeLeftView移除左侧bool,默认为false
removeCenterView移除中间bool,默认为false
removeRightView移除右侧bool,默认为false
hiddenTopLine隐藏上划线默认为true
topLineStyle上划线样式
topLineLeftMargin上划线左边距数字
topLineRightMargin上划线右边距数字
hiddenBottomLine隐藏下划线默认为false
bottomLineStyle下划线样式
bottomLineLeftMargin下划线左边距数字,默认左边距为15
bottomLineRightMargin下划线右边距数字

具体的使用方法请参考示例 https://github.com/LiuC520/react-native-public-component/blob/master/example/App.js

上面的样式或者icon为number表示常量,图标为require导入的,如果uri导入表示对象,具体参考示例

1.0.10

2 years ago

1.0.9

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago