ant-design/components/card/demo/meta.md

45 lines
896 B
Markdown
Raw Normal View History

---
order: 9
title:
zh-CN: 支持更多内容配置
en-US: Support more content configuration
---
## zh-CN
一种支持封面、头像、标题和描述信息的卡片。
## en-US
A Card that supports `cover`, `avatar`, `title` and `description`.
2019-05-07 14:57:32 +08:00
```jsx
import { Card, Icon, Avatar } from 'antd';
2018-06-27 15:55:04 +08:00
const { Meta } = Card;
ReactDOM.render(
<Card
style={{ width: 300 }}
2019-05-07 14:57:32 +08:00
cover={
<img
alt="example"
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
/>
}
2019-08-02 18:19:06 +08:00
actions={[
<Icon type="setting" key="setting" />,
<Icon type="edit" key="edit" />,
<Icon type="ellipsis" key="ellipsis" />,
]}
>
<Meta
avatar={<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />}
title="Card title"
description="This is the description"
/>
2018-06-27 15:55:04 +08:00
</Card>,
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
```