mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-08 20:38:39 +08:00
7fd093bd0a
* docs: add general components TS demo * docs: add layout components TS demo * docs: add navigation components TS demo * docs: add data entry components TS demo * chore(deps): add types for qs * docs: add data display TS demo * docs: add feedback components TS demo * docs: add other components TS demo * chore(deps): add types * docs: unified demo code style * docs: fix lint error * docs: add demo TS type * docs: fix demo TS type * test: update snapshot * docs: fix TS demo * feat: update Rate character type * docs: fix lint error * feat: update Rate character type * feat: update Rate character type
48 lines
980 B
Markdown
48 lines
980 B
Markdown
---
|
|
order: 9
|
|
title:
|
|
zh-CN: 支持更多内容配置
|
|
en-US: Support more content configuration
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
一种支持封面、头像、标题和描述信息的卡片。
|
|
|
|
## en-US
|
|
|
|
A Card that supports `cover`, `avatar`, `title` and `description`.
|
|
|
|
```tsx
|
|
import React from 'react';
|
|
import { Card, Avatar } from 'antd';
|
|
import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons';
|
|
|
|
const { Meta } = Card;
|
|
|
|
const App: React.FC = () => (
|
|
<Card
|
|
style={{ width: 300 }}
|
|
cover={
|
|
<img
|
|
alt="example"
|
|
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
|
|
/>
|
|
}
|
|
actions={[
|
|
<SettingOutlined key="setting" />,
|
|
<EditOutlined key="edit" />,
|
|
<EllipsisOutlined key="ellipsis" />,
|
|
]}
|
|
>
|
|
<Meta
|
|
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
|
|
title="Card title"
|
|
description="This is the description"
|
|
/>
|
|
</Card>
|
|
);
|
|
|
|
export default App;
|
|
```
|