mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
fix Icon.createFromIconfontCN usage
This commit is contained in:
parent
1ecd2b4150
commit
633d73b21a
@ -98,12 +98,10 @@ This method is specified for [iconfont.cn](http://iconfont.cn/).
|
||||
|
||||
```js
|
||||
const MyIcon = Icon.createFromIconfontCN({
|
||||
namespace: 'foo', // identifier
|
||||
scriptUrl: 'at.alicdn.com/t/font_8d5l8fzk5b87iudi', // generated by iconfont.cn
|
||||
prefix: 'icon-',
|
||||
scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js', // generated by iconfont.cn
|
||||
});
|
||||
|
||||
ReactDOM.render(<MyIcon type="example" />, mountedNode);
|
||||
ReactDOM.render(<MyIcon type="icon-example" />, mountedNode);
|
||||
```
|
||||
|
||||
It create a component that uses SVG sprites in essence.
|
||||
|
@ -102,12 +102,10 @@ ReactDOM.render(
|
||||
|
||||
```js
|
||||
const MyIcon = Icon.createFromIconfontCN({
|
||||
namespace: 'foo', // identifier
|
||||
scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js', // generated by iconfont.cn
|
||||
prefix: 'icon-',
|
||||
});
|
||||
|
||||
ReactDOM.render(<MyIcon type="example" />, mountedNode);
|
||||
ReactDOM.render(<MyIcon type="icon-example" />, mountedNode);
|
||||
```
|
||||
|
||||
其本质上是创建了一个使用 `<use>` 标签来渲染图标的组件。
|
||||
|
Loading…
Reference in New Issue
Block a user