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.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2018-07-29 16:33:26 +08:00
|
|
|
import { Button } from 'antd';
|
2022-05-23 14:37:16 +08:00
|
|
|
import React from 'react';
|
2018-07-29 16:33:26 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
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>
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|