use ghost button to match primary button

pull/432/head
afc163 9 years ago
parent cad3fdff45
commit 5a50df6b78

@ -6,6 +6,8 @@
通过设置 `type``primary` `ghost` 可分别创建主按钮、幽灵按钮,若不设置 `type` 值则为次按钮。不同的样式可以用来区别其重要程度。
主按钮和次按钮可独立使用,需要强引导用主按钮。幽灵按钮用于和主按钮组合。
---
````jsx

@ -73,13 +73,13 @@ export default function (props) {
<div className="ant-confirm-content">{props.content}</div>
</div>;
let footer = <div className="ant-confirm-btns">
<Button size="large" onClick={onCancel}> </Button>
<Button type="ghost" size="large" onClick={onCancel}> </Button>
<Button type="primary" size="large" onClick={onOk}> </Button>
</div>;
if (props.okCancel) {
footer = <div className="ant-confirm-btns">
<Button size="large" onClick={onCancel}> </Button>
<Button type="ghost" size="large" onClick={onCancel}> </Button>
<Button type="primary" size="large" onClick={onOk}> </Button>
</div>;
} else {

@ -40,7 +40,7 @@ var Test = React.createClass({
visible={this.state.visible}
title="对话框标题" onOk={this.handleOk} onCancel={this.handleCancel}
footer={[
<Button key="back" size="large" onClick={this.handleCancel}>返 回</Button>,
<Button key="back" type="ghost" size="large" onClick={this.handleCancel}>返 回</Button>,
<Button key="submit" type="primary" size="large" loading={this.state.loading} onClick={this.handleOk}>
提 交
</Button>

@ -76,13 +76,18 @@ let AntModal = React.createClass({
render() {
let props = this.props;
let defaultFooter = [
<Button key="cancel" size="large" onClick={this.handleCancel}> </Button>,
<Button key="cancel"
type="ghost"
size="large"
onClick={this.handleCancel}>
取消
</Button>,
<Button key="confirm"
type="primary"
size="large"
loading={this.state.confirmLoading}
onClick={this.handleOk}>
</Button>
];
let footer = props.footer || defaultFooter;

@ -48,8 +48,8 @@ export default React.createClass({
</p>
<div className={prefixCls + '-buttons'}>
<Button onClick={this.cancel} size="small"> </Button>
<Button onClick={this.confirm} type="primary" size="small"> </Button>
<Button onClick={this.cancel} type="ghost" size="small"></Button>
<Button onClick={this.confirm} type="primary" size="small"></Button>
</div>
</div>
</div>;

@ -302,7 +302,7 @@ var Form = React.createClass({
<div className="col-offset-7 col-12">
<Button type="primary" onClick={this.handleSubmit}>确 定</Button>
&nbsp;&nbsp;&nbsp;
<Button onClick={this.handleReset}>重 置</Button>
<Button type="ghost" onClick={this.handleReset}>重 置</Button>
</div>
</div>
</Validation>

@ -192,7 +192,7 @@ var Form = React.createClass({
<div className="col-offset-6 col-12">
<Button type="primary" onClick={this.handleSubmit}>确 定</Button>
&nbsp;&nbsp;&nbsp;
<Button onClick={this.handleReset}>重 置</Button>
<Button type="ghost" onClick={this.handleReset}>重 置</Button>
</div>
</div>
</Validation>

Loading…
Cancel
Save