2016-03-31 14:17:09 +08:00
|
|
|
|
---
|
|
|
|
|
category: Components
|
2018-11-04 16:20:35 +08:00
|
|
|
|
type: 数据展示
|
2016-05-26 17:46:55 +08:00
|
|
|
|
title: Card
|
|
|
|
|
subtitle: 卡片
|
2016-06-17 15:39:05 +08:00
|
|
|
|
cols: 1
|
2020-05-31 11:48:34 +08:00
|
|
|
|
cover: https://gw.alipayobjects.com/zos/antfincdn/NqXt8DJhky/Card.svg
|
2016-03-31 14:17:09 +08:00
|
|
|
|
---
|
2016-02-19 19:35:49 +08:00
|
|
|
|
|
|
|
|
|
通用卡片容器。
|
|
|
|
|
|
|
|
|
|
## 何时使用
|
|
|
|
|
|
|
|
|
|
最基础的卡片容器,可承载文字、列表、图片、段落,常用于后台概览页面。
|
|
|
|
|
|
2016-02-20 16:40:18 +08:00
|
|
|
|
## API
|
|
|
|
|
|
2019-12-26 14:37:39 +08:00
|
|
|
|
```jsx
|
2016-02-19 19:35:49 +08:00
|
|
|
|
<Card title="卡片标题">卡片内容</Card>
|
|
|
|
|
```
|
|
|
|
|
|
2017-07-07 13:36:54 +08:00
|
|
|
|
### Card
|
|
|
|
|
|
2019-07-11 14:14:33 +08:00
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
|
|
|
|
| actions | 卡片操作组,位置在卡片底部 | Array<ReactNode> | - | |
|
2019-11-20 20:31:43 +08:00
|
|
|
|
| activeTabKey | 当前激活页签的 key | string | - | |
|
2020-04-28 14:09:54 +08:00
|
|
|
|
| bodyStyle | 内容区域自定义样式 | CSSProperties | - | |
|
2019-07-11 14:14:33 +08:00
|
|
|
|
| bordered | 是否有边框 | boolean | true | |
|
|
|
|
|
| cover | 卡片封面 | ReactNode | - | |
|
2020-06-17 23:18:14 +08:00
|
|
|
|
| defaultActiveTabKey | 初始化选中页签的 key,如果没有设置 activeTabKey | string | `第一个页签` | |
|
2020-10-09 10:08:52 +08:00
|
|
|
|
| extra | 卡片右上角的操作区域 | ReactNode | - | |
|
2020-10-21 10:33:43 +08:00
|
|
|
|
| headStyle | 自定义标题区域样式 | CSSProperties | - | |
|
2019-07-11 14:14:33 +08:00
|
|
|
|
| hoverable | 鼠标移过时可浮起 | boolean | false | |
|
|
|
|
|
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false | |
|
2019-11-20 20:31:43 +08:00
|
|
|
|
| size | card 的尺寸 | `default` \| `small` | `default` | |
|
2020-10-21 10:33:43 +08:00
|
|
|
|
| tabBarExtraContent | tab bar 上额外的元素 | ReactNode | - | |
|
|
|
|
|
| tabList | 页签标题列表 | Array<{key: string, tab: ReactNode}> | - | |
|
|
|
|
|
| tabProps | [Tabs](/components/tabs/#Tabs) | - | - | |
|
2020-10-09 10:08:52 +08:00
|
|
|
|
| title | 卡片标题 | ReactNode | - | |
|
2019-07-11 14:14:33 +08:00
|
|
|
|
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - | |
|
|
|
|
|
| onTabChange | 页签切换的回调 | (key) => void | - | |
|
2017-07-07 13:36:54 +08:00
|
|
|
|
|
|
|
|
|
### Card.Grid
|
|
|
|
|
|
2021-03-01 19:20:48 +08:00
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
|
|
|
|
| className | 网格容器类名 | string | - | |
|
|
|
|
|
| hoverable | 鼠标移过时可浮起 | boolean | true | |
|
|
|
|
|
| style | 定义网格容器类名的样式 | CSSProperties | - | |
|
2017-08-09 14:34:10 +08:00
|
|
|
|
|
|
|
|
|
### Card.Meta
|
|
|
|
|
|
2021-03-01 19:20:48 +08:00
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
|
|
|
|
| avatar | 头像/图标 | ReactNode | - | |
|
|
|
|
|
| className | 容器类名 | string | - | |
|
|
|
|
|
| description | 描述内容 | ReactNode | - | |
|
|
|
|
|
| style | 定义容器类名的样式 | CSSProperties | - | |
|
|
|
|
|
| title | 标题内容 | ReactNode | - | |
|