Browse Source

fix Icon.createFromIconfontCN usage

pull/12212/head
HeskeyBaozi 6 years ago
committed by 偏右
parent
commit
633d73b21a
  1. 6
      components/icon/index.en-US.md
  2. 4
      components/icon/index.zh-CN.md

6
components/icon/index.en-US.md

@ -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.

4
components/icon/index.zh-CN.md

@ -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…
Cancel
Save