2018-07-19 19:24:19 +08:00
|
|
|
---
|
|
|
|
order: 0
|
|
|
|
title:
|
|
|
|
zh-CN: 基本用法
|
|
|
|
en-US: Basic
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
2018-07-20 16:55:45 +08:00
|
|
|
使用 `<Icon />` 标签声明组件,指定图标对应的 `type` 属性。可以通过设置 `spin` 属性来实现动画旋转效果。
|
2018-07-19 19:24:19 +08:00
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Use tag `<Icon />` to create an icon and set its type in the `type` prop.
|
|
|
|
|
|
|
|
````jsx
|
|
|
|
import { Icon } from 'antd';
|
|
|
|
|
|
|
|
ReactDOM.render(
|
2018-08-14 17:17:51 +08:00
|
|
|
<div className="icons-list">
|
2018-08-06 18:10:30 +08:00
|
|
|
<Icon type="home" />
|
2018-07-19 21:07:33 +08:00
|
|
|
<Icon type="setting" />
|
|
|
|
<Icon type="smile" />
|
2018-08-14 17:17:51 +08:00
|
|
|
<Icon type="smile" rotate={90} />
|
2018-07-20 10:32:00 +08:00
|
|
|
<Icon type="reload" spin />
|
2018-07-19 19:24:19 +08:00
|
|
|
</div>,
|
|
|
|
mountNode
|
|
|
|
);
|
|
|
|
````
|
2018-08-14 17:17:51 +08:00
|
|
|
|
|
|
|
```css
|
|
|
|
.icons-list > .anticon {
|
|
|
|
margin-right: 6px;
|
|
|
|
}
|
|
|
|
```
|