0.1.0 • Published 6 years ago

rn-btn v0.1.0

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

rn-btn

react native button

npm.io

使用

import RNBtn from 'rn-btn'

export default class App extends Component {
    render () {
        return (
            <View style={{flex: 1}}>
                <RNBtn
					text="小号文字按钮"
					type={'text'}
					size={'small'}
				/>
                <RNBtn
					text="小号按钮"
					size={'small'}
                />

				<RNBtn
					text="默认文字大小按钮"
					type={'text'}
					size={'default'}
				/>
                <RNBtn
					text="默认大小按钮"
					size={'default'}
                />

				<RNBtn
					text="偏大号文字按钮"
					type={'text'}
					size={'large'}
				/>
                <RNBtn
					text="偏大号按钮"
					size={'large'}
                />

				<RNBtn
					text="巨大号文字"
					type={'text'}
					size={'huge'}
				/>
                <RNBtn
					text="巨大号å按钮"
					size={'huge'}
                />

				<RNBtn
                    text="默认"
                    style={myStyle.loginOutBtn}
					callback={(that) => {
						LoginOut(this.props.navigation)
					}}
                />
				<RNBtn
                    text="主要"
                    style={myStyle.loginOutBtn}
					theme={'main'}
					callback={(that) => {
						LoginOut(this.props.navigation)
					}}
                />
				<RNBtn
                    text="警告"
                    style={myStyle.loginOutBtn}
					theme={'warn'}
					callback={(that) => {
						LoginOut(this.props.navigation)
					}}
                />
				<RNBtn
                    text="错误"
                    style={myStyle.loginOutBtn}
					theme={'error'}
					callback={(that) => {
						LoginOut(this.props.navigation)
					}}
                />
            </View>
        )
    }
}

const myStyle = StyleSheet.create({
    loginOutBtn: {
		margin: 5,
		borderRadius: 3
    }
})

API

参数类型说明
textString文字内容
size'small','default','large','huge'大小,
shadowBoolean阴影效果或无
type'text'文字效果或无
disabledBoolean是否禁用
disabledStyleStyle自定义禁用样式
theme'main','warn','error'按钮样式或无,与type的不同效果不同
styleStyle自定义按钮样式
callbackFunction回调函数
0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.4

6 years ago

0.0.1

6 years ago