-
-
Notifications
You must be signed in to change notification settings - Fork 50.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Button[ghost] property, close #4625 * Add danger button close #1308 * update API doc about ghost and danger property
- Loading branch information
Showing
11 changed files
with
107 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,19 +7,15 @@ title: | |
|
||
## zh-CN | ||
|
||
按钮有四种类型:主按钮、次按钮、幽灵按钮、虚线按钮。 | ||
按钮有四种类型:主按钮、次按钮、虚线按钮、危险按钮。主按钮在同一个操作区域最多出现一次。 | ||
|
||
通过设置 `type` 为 `primary` `ghost` `dashed` 可分别创建主按钮、幽灵按钮、虚线按钮,若不设置 `type` 值则为次按钮。不同的样式可以用来区别其重要程度。 | ||
|
||
主按钮和次按钮可独立使用,幽灵按钮用于和主按钮组合。需要强引导用主按钮,切记主按钮在同一个操作区域最多出现一次。 | ||
> `danger` 在 `[email protected]` 后支持。 | ||
## en-US | ||
|
||
There are primary button, default button, ghost button and dashed button in antd. | ||
|
||
`type` can be set as `primary` or `ghost` or `dashed`, in order to create primary button or ghost button or dashed button. If nothing is provided to `type`, we will get default button. Users can tell the significance of button from it's appearance. | ||
There are `primary` button, `default` button, `dashed` button and `danger` button in antd. | ||
|
||
Primary button and default button can be used without other button, but ghost button must be used with primary button. | ||
> `danger` is supported after `[email protected]`. | ||
````__react | ||
import { Button } from 'antd'; | ||
|
@@ -28,8 +24,8 @@ ReactDOM.render( | |
<div> | ||
<Button type="primary">Primary</Button> | ||
<Button>Default</Button> | ||
<Button type="ghost">Ghost</Button> | ||
<Button type="dashed">Dashed</Button> | ||
<Button type="danger">Danger</Button> | ||
</div> | ||
, mountNode); | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 5 | ||
order: 6 | ||
title: | ||
zh-CN: 按钮组合 | ||
en-US: Button Group | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
order: 8 | ||
title: | ||
zh-CN: 幽灵按钮 | ||
en-US: Ghost Button | ||
--- | ||
|
||
## zh-CN | ||
|
||
幽灵按钮将其他按钮的内容反色,背景变为透明,常用在有色背景上。 | ||
|
||
## en-US | ||
|
||
`ghost` property will make button's background transparent, it is common used in colored background. | ||
|
||
````__react | ||
import { Button } from 'antd'; | ||
ReactDOM.render( | ||
<div style={{ background: 'rgb(190, 200, 200)', padding: '26px 16px 16px' }}> | ||
<Button type="primary" ghost>Primary Ghost</Button> | ||
<Button ghost>Default Ghost</Button> | ||
<Button type="dashed" ghost>Dashed Ghost</Button> | ||
</div> | ||
, mountNode); | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 6 | ||
order: 5 | ||
title: | ||
zh-CN: 多个按钮组合 | ||
en-US: Multiple Buttons | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
false
should be formatted into block of code