2020-04-28 18:14:07 +08:00
---
order: 4
title:
zh-CN: 使用 iconfont.cn 的多个资源
en-US: Multiple resources from iconfont.cn
---
## zh-CN
`@ant-design/icons@4.1.0` 以后,`scriptUrl` 可引用多个资源,用户可灵活的管理 [iconfont.cn ](http://iconfont.cn/ ) 图标。如果资源的图标出现重名,会按照数组顺序进行覆盖。
## en-US
You can use `scriptUrl` as an array after `@ant-design/icons@4.1.0` , manage icons in one `<Icon />` from multiple [iconfont.cn ](http://iconfont.cn/ ) resources. If icon with a duplicate name in resources, it will overrided in array order.
2022-05-19 09:46:26 +08:00
```tsx
2020-04-28 18:14:07 +08:00
import { createFromIconfontCN } from '@ant-design/icons';
2022-05-23 14:37:16 +08:00
import { Space } from 'antd';
import React from 'react';
2020-04-28 18:14:07 +08:00
const IconFont = createFromIconfontCN({
scriptUrl: [
'//at.alicdn.com/t/font_1788044_0dwu4guekcwr.js', // icon-javascript, icon-java, icon-shoppingcart (overrided)
'//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js', // icon-shoppingcart, icon-python
],
});
2022-05-19 09:46:26 +08:00
const App: React.FC = () => (
2022-01-13 20:32:09 +08:00
< Space >
2020-04-28 18:14:07 +08:00
< IconFont type = "icon-javascript" / >
< IconFont type = "icon-java" / >
< IconFont type = "icon-shoppingcart" / >
< IconFont type = "icon-python" / >
2022-04-03 23:27:45 +08:00
< / Space >
2020-04-28 18:14:07 +08:00
);
2022-05-19 09:46:26 +08:00
export default App;
2020-04-28 18:14:07 +08:00
```