You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
946 B
51 lines
946 B
6 years ago
|
---
|
||
|
order: 2
|
||
|
title:
|
||
|
zh-CN: 在卡片中使用
|
||
|
en-US: In Card
|
||
|
---
|
||
|
|
||
|
## zh-CN
|
||
|
|
||
|
在卡片中展示统计数值。
|
||
|
|
||
|
## en-US
|
||
|
|
||
|
Display statistic data in Card.
|
||
|
|
||
|
```jsx
|
||
|
import { Statistic, Card, Row, Col, Icon } from 'antd';
|
||
|
|
||
|
ReactDOM.render(
|
||
|
<div style={{ background: '#ECECEC', padding: '30px' }}>
|
||
|
<Row gutter={16}>
|
||
|
<Col span={12}>
|
||
|
<Card>
|
||
|
<Statistic
|
||
|
title="Active"
|
||
|
value={11.28}
|
||
|
precision={2}
|
||
|
valueStyle={{ color: '#3f8600' }}
|
||
|
prefix={<Icon type="arrow-up" />}
|
||
|
suffix="%"
|
||
|
/>
|
||
|
</Card>
|
||
|
</Col>
|
||
|
<Col span={12}>
|
||
|
<Card>
|
||
|
<Statistic
|
||
|
title="Idle"
|
||
|
value={9.3}
|
||
|
precision={2}
|
||
|
valueStyle={{ color: '#cf1322' }}
|
||
|
prefix={<Icon type="arrow-down" />}
|
||
|
suffix="%"
|
||
|
/>
|
||
|
</Card>
|
||
|
</Col>
|
||
|
</Row>
|
||
|
</div>,
|
||
|
mountNode
|
||
|
);
|
||
|
```
|