2018-07-29 16:33:26 +08:00
|
|
|
---
|
2020-01-03 15:22:16 +08:00
|
|
|
order: 10
|
2018-07-29 16:33:26 +08:00
|
|
|
title:
|
2020-01-03 15:22:16 +08:00
|
|
|
zh-CN: Block 按钮
|
|
|
|
en-US: Block Button
|
2018-07-29 16:33:26 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
`block`属性将使按钮适合其父宽度。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
`block` property will make the button fit to its parent width.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2018-07-29 16:33:26 +08:00
|
|
|
import { Button } from 'antd';
|
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<div>
|
2019-05-07 14:57:32 +08:00
|
|
|
<Button type="primary" block>
|
|
|
|
Primary
|
|
|
|
</Button>
|
2018-07-29 16:33:26 +08:00
|
|
|
<Button block>Default</Button>
|
2019-05-07 14:57:32 +08:00
|
|
|
<Button type="dashed" block>
|
|
|
|
Dashed
|
|
|
|
</Button>
|
2019-11-22 13:59:20 +08:00
|
|
|
<Button type="link" block>
|
|
|
|
Link
|
|
|
|
</Button>
|
2018-07-29 16:33:26 +08:00
|
|
|
</div>,
|
2019-05-07 14:57:32 +08:00
|
|
|
mountNode,
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|