button - Maixbxp/salt-ui GitHub Wiki
描述:自定义的扩展样式名称
类型:String
默认:''
必填:否
描述:按钮失效
类型:Boolean
默认:false
必填:否
描述:按钮的类型, 可选的参数 primary、secondary、minor、danger、text
类型:String
默认:'primary'
必填:否
描述:按钮的大小, 可选的参数 small 、medium 、large
类型:String
默认:'large'
必填:否
描述:按钮点击时的回调
类型:Function
默认:noop
必填:否
描述:按钮的行内样式复写
类型:object
默认:{}
必填:否
let View = React.createClass({
handleClick() {
console.log('a button clicked')
},
render() {
return (
<div style={{padding:'20px'}}>
<Button>默认按钮</Button> <br/>
<Button type="primary" onClick={this.handleClick}>一级按钮</Button> <br/>
<Button type="secondary" onClick={this.handleClick}>二级按钮</Button> <br/>
<Button type="minor" onClick={this.handleClick}>次要按钮</Button> <br/>
<Button disabled={true}>不可点击</Button> <br/>
<div className="demo-row">
<div className="demo-cell"><Button type="primary" onClick={this.handleClick}>一级按钮</Button></div>
<div className="demo-cell"><Button type="secondary" onClick={this.handleClick}>二级按钮</Button></div>
</div> <br/>
<Button style={{marginLeft:-20,marginRight:-20,borderRadius:0}} onClick={this.handleClick}>通栏按钮</Button> <br/>
<Button type="primary" size="large" onClick={this.handleClick}>大按钮</Button> <br/>
<Button type="primary" size="medium" onClick={this.handleClick}>中按钮</Button> <br/>
<Button type="primary" size="small" onClick={this.handleClick}>小按钮</Button> <br/>
</div>
)
}
})