2018-07-19 19:24:19 +08:00
|
|
|
---
|
2018-08-14 17:17:51 +08:00
|
|
|
order: 3
|
2018-07-19 19:24:19 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 使用 iconfont.cn
|
|
|
|
en-US: Use iconfont.cn
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
2018-09-04 17:29:37 +08:00
|
|
|
对于使用 [iconfont.cn](http://iconfont.cn/) 的用户,通过设置 `createFromIconfontCN` 方法参数对象中的 `scriptUrl` 字段, 即可轻松地使用已有项目中的图标。
|
2018-07-19 19:24:19 +08:00
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
2018-08-20 17:23:28 +08:00
|
|
|
If you are using [iconfont.cn](http://iconfont.cn/), you can use the icons in your project gracefully.
|
2018-07-19 19:24:19 +08:00
|
|
|
|
|
|
|
````jsx
|
|
|
|
import { Icon } from 'antd';
|
|
|
|
|
2018-08-16 16:13:18 +08:00
|
|
|
const IconFont = Icon.createFromIconfontCN({
|
2018-08-21 17:52:41 +08:00
|
|
|
scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js',
|
2018-07-19 19:24:19 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
ReactDOM.render(
|
2018-08-14 17:17:51 +08:00
|
|
|
<div className="icons-list">
|
2018-08-21 18:41:35 +08:00
|
|
|
<IconFont type="icon-tuichu" />
|
|
|
|
<IconFont type="icon-facebook" />
|
|
|
|
<IconFont type="icon-twitter" />
|
2018-07-19 19:24:19 +08:00
|
|
|
</div>,
|
|
|
|
mountNode
|
|
|
|
);
|
|
|
|
````
|