2019-05-22 23:22:09 +08:00
|
|
|
---
|
|
|
|
order: 2
|
|
|
|
title:
|
|
|
|
zh-CN: 自定义尺寸
|
|
|
|
en-US: Custom size
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
自定义尺寸,适应在各种容器中展示。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Custom sizes to fit in a variety of containers.
|
|
|
|
|
|
|
|
```jsx
|
2020-07-14 20:37:21 +08:00
|
|
|
import { Descriptions, Radio, Button } from 'antd';
|
2019-05-22 23:22:09 +08:00
|
|
|
|
|
|
|
class Demo extends React.Component {
|
|
|
|
state = {
|
|
|
|
size: 'default',
|
|
|
|
};
|
|
|
|
|
|
|
|
onChange = e => {
|
|
|
|
console.log('size checked', e.target.value);
|
|
|
|
this.setState({
|
|
|
|
size: e.target.value,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
2019-05-27 21:32:45 +08:00
|
|
|
<Radio.Group onChange={this.onChange} value={this.state.size}>
|
2019-05-22 23:22:09 +08:00
|
|
|
<Radio value="default">default</Radio>
|
|
|
|
<Radio value="middle">middle</Radio>
|
|
|
|
<Radio value="small">small</Radio>
|
2019-05-27 21:32:45 +08:00
|
|
|
</Radio.Group>
|
2019-05-22 23:22:09 +08:00
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-14 20:37:21 +08:00
|
|
|
<Descriptions
|
|
|
|
bordered
|
|
|
|
title="Custom Size"
|
|
|
|
size={this.state.size}
|
|
|
|
extra={<Button type="primary">Edit</Button>}
|
|
|
|
>
|
2019-05-27 21:32:45 +08:00
|
|
|
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Billing">Prepaid</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="time">18:00:00</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Amount">$80.00</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Discount">$20.00</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Official">$60.00</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Config Info">
|
2019-05-22 23:22:09 +08:00
|
|
|
Data disk type: MongoDB
|
|
|
|
<br />
|
|
|
|
Database version: 3.4
|
|
|
|
<br />
|
|
|
|
Package: dds.mongo.mid
|
|
|
|
<br />
|
|
|
|
Storage space: 10 GB
|
|
|
|
<br />
|
2019-11-06 10:42:10 +08:00
|
|
|
Replication factor: 3
|
2019-05-22 23:22:09 +08:00
|
|
|
<br />
|
|
|
|
Region: East China 1<br />
|
2019-05-27 21:32:45 +08:00
|
|
|
</Descriptions.Item>
|
2019-05-22 23:22:09 +08:00
|
|
|
</Descriptions>
|
2019-08-16 10:01:46 +08:00
|
|
|
<br />
|
|
|
|
<br />
|
2020-07-14 20:37:21 +08:00
|
|
|
<Descriptions
|
|
|
|
title="Custom Size"
|
|
|
|
size={this.state.size}
|
|
|
|
extra={<Button type="primary">Edit</Button>}
|
|
|
|
>
|
2019-08-16 10:01:46 +08:00
|
|
|
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Billing">Prepaid</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="time">18:00:00</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Amount">$80.00</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Discount">$20.00</Descriptions.Item>
|
|
|
|
<Descriptions.Item label="Official">$60.00</Descriptions.Item>
|
|
|
|
</Descriptions>
|
2019-05-22 23:22:09 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ReactDOM.render(<Demo />, mountNode);
|
|
|
|
```
|