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
|
|
|
|
|
2020-11-08 15:04:02 +08:00
|
|
|
`block` 属性将使按钮适合其父宽度。
|
2018-07-29 16:33:26 +08:00
|
|
|
|
|
|
|
## 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(
|
2020-06-11 15:24:24 +08:00
|
|
|
<>
|
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>
|
2020-06-11 15:24:24 +08:00
|
|
|
</>,
|
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
|
|
|
```
|