ant-design/components/button/demo/basic.md

37 lines
1.2 KiB
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 0
2016-04-20 16:28:07 +08:00
title:
zh-CN: 按钮类型
en-US: Type
2016-03-31 09:40:55 +08:00
---
2016-04-20 16:28:07 +08:00
## zh-CN
2016-04-20 16:28:07 +08:00
按钮有四种类型:主按钮、次按钮、幽灵按钮、虚线按钮。
2015-05-15 16:00:08 +08:00
2016-04-20 16:28:07 +08:00
通过设置 `type``primary` `ghost` `dashed` 可分别创建主按钮、幽灵按钮、虚线按钮,若不设置 `type` 值则为次按钮。不同的样式可以用来区别其重要程度。
主按钮和次按钮可独立使用,幽灵按钮用于和主按钮组合。需要强引导用主按钮,切记主按钮在同一个操作区域最多出现一次。
## 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.
Primary button and default button can be used without other button, but ghost button must be used with primary button.
2015-09-27 16:30:35 +08:00
````jsx
import { Button } from 'antd';
2015-09-27 16:30:35 +08:00
2016-04-20 16:28:07 +08:00
ReactDOM.render(
<div>
<Button type="primary">Primary</Button>
<Button>Default</Button>
<Button type="ghost">Ghost</Button>
<Button type="dashed">Dashed</Button>
</div>,
mountNode
);
2015-05-15 16:00:08 +08:00
````