afc163
9 years ago
7 changed files with 138 additions and 14 deletions
@ -0,0 +1,36 @@ |
|||
# 栅格卡片 |
|||
|
|||
- order: 3 |
|||
|
|||
在系统概览页面常常和栅格进行配合。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
import { Card, Col, Row } from 'antd'; |
|||
|
|||
ReactDOM.render( |
|||
<Row> |
|||
<Col span="8"> |
|||
<Card title="卡片标题">卡片的内容</Card> |
|||
</Col> |
|||
<Col span="8"> |
|||
<Card title="卡片标题">卡片的内容</Card> |
|||
</Col> |
|||
<Col span="8"> |
|||
<Card title="卡片标题">卡片的内容</Card> |
|||
</Col> |
|||
</Row> |
|||
, mountNode); |
|||
```` |
|||
|
|||
````css |
|||
/* 增加 16px 栅格间距 */ |
|||
.row { |
|||
margin-left: -8px; |
|||
margin-right: -8px; |
|||
} |
|||
.row > div { |
|||
padding: 0 8px; |
|||
} |
|||
```` |
@ -0,0 +1,35 @@ |
|||
# 更灵活的内容展示 |
|||
|
|||
- order: 2 |
|||
|
|||
可以调整默认边距,设定宽度。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
import { Card } from 'antd'; |
|||
|
|||
ReactDOM.render( |
|||
<Card style={{ width: 240 }} bodyStyle={{ padding: 0 }}> |
|||
<div className="custom-image"> |
|||
<img width="100%" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" /> |
|||
</div> |
|||
<div className="custom-card"> |
|||
<h3>欧美街拍</h3> |
|||
<p>www.instagram.com</p> |
|||
</div> |
|||
</Card> |
|||
, mountNode); |
|||
```` |
|||
|
|||
````css |
|||
.custom-image img { |
|||
display: block; |
|||
} |
|||
.custom-card { |
|||
padding: 10px 16px; |
|||
} |
|||
.custom-card p { |
|||
color: #999; |
|||
} |
|||
```` |
@ -0,0 +1,17 @@ |
|||
# 简洁卡片 |
|||
|
|||
- order: 1 |
|||
|
|||
只包含内容区域。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
import { Card } from 'antd'; |
|||
|
|||
ReactDOM.render( |
|||
<Card style={{ width: 300 }}> |
|||
卡片的内容 |
|||
</Card> |
|||
, mountNode); |
|||
```` |
Loading…
Reference in new issue