我已经用npm install material-ui
安装了库。
当我使用组件<FontIcon className='mui-icon-sort' />
时,没有显示图标。
你知道如何解决这个问题吗?
@checkraiser您需要在项目中添加Google 字体库才能使用带有<FontIcon>
方法的图标。 或者,您可以从 Google 网络字体<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
添加 Google 材料图标,并使用如下所述的图标:
<RaisedButton>
<i className="material-icons" style={{color: 'white'}}>sort</i>
</RaisedButton>
<FloatingActionButton>
<i className="material-icons" style={{color: 'white'}}>sort</i>
</FloatingActionButton>
谢谢@mairh - 还有这个问题为库内的谷歌字体库提供支持。 见#829
@mairh我们不能使用 Material-UI 中的图标吗?
包括Google Material UI字体库破坏目的,也是48KB
最有用的评论
@checkraiser您需要在项目中添加Google 字体库才能使用带有
<FontIcon>
方法的图标。 或者,您可以从 Google 网络字体<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
添加 Google 材料图标,并使用如下所述的图标: