2019-11-20 11:13:24 +08:00
|
|
|
---
|
|
|
|
order: 7
|
|
|
|
title:
|
|
|
|
zh-CN: Flex 填充
|
|
|
|
en-US: Flex Stretch
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
Col 提供 `flex` 属性以支持填充。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Col provides `flex` prop to support fill rest.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2022-05-23 14:37:16 +08:00
|
|
|
import { Col, Divider, Row } from 'antd';
|
2022-05-19 09:46:26 +08:00
|
|
|
import React from 'react';
|
2019-11-20 11:13:24 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2020-02-26 21:00:43 +08:00
|
|
|
<>
|
2020-08-05 11:28:57 +08:00
|
|
|
<Divider orientation="left">Percentage columns</Divider>
|
2019-11-20 11:13:24 +08:00
|
|
|
<Row>
|
|
|
|
<Col flex={2}>2 / 5</Col>
|
|
|
|
<Col flex={3}>3 / 5</Col>
|
|
|
|
</Row>
|
2020-08-05 11:28:57 +08:00
|
|
|
<Divider orientation="left">Fill rest</Divider>
|
2019-11-20 11:13:24 +08:00
|
|
|
<Row>
|
|
|
|
<Col flex="100px">100px</Col>
|
|
|
|
<Col flex="auto">Fill Rest</Col>
|
|
|
|
</Row>
|
2020-08-05 11:28:57 +08:00
|
|
|
<Divider orientation="left">Raw flex style</Divider>
|
2019-11-20 11:13:24 +08:00
|
|
|
<Row>
|
|
|
|
<Col flex="1 1 200px">1 1 200px</Col>
|
|
|
|
<Col flex="0 1 300px">0 1 300px</Col>
|
|
|
|
</Row>
|
2020-10-30 22:13:23 +08:00
|
|
|
|
|
|
|
<Row wrap={false}>
|
|
|
|
<Col flex="none">
|
|
|
|
<div style={{ padding: '0 16px' }}>none</div>
|
|
|
|
</Col>
|
|
|
|
<Col flex="auto">auto with no-wrap</Col>
|
|
|
|
</Row>
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2019-11-20 11:13:24 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-11-20 11:13:24 +08:00
|
|
|
```
|