【发布时间】:2018-12-12 14:58:36
【问题描述】:
我想在我的 material-ui Button 组件中使用 fontawesome 图标。但我不能那样做。你知道为什么吗? (我正在使用 React 和 react-admin 框架。)
import '../../../node_modules/font-awesome/css/font-awesome.min.css';
import Button from '@material-ui/core/Button';
....
<Button style={{
backgroundColor: '#5cb85c',
color: 'white'
}}
onClick={() => this.codeGenerate()}>
<i className="fa fa-star"></i>
</Button>
【问题讨论】:
-
你安装了 font awesome npm 模块吗?
-
是的,当然。使用“npm install --save font-awesome”命令。我的节点模块目录中有这个模块
-
错误是什么?
-
错误是图标没有出现在按钮上。仅显示文本
标签: reactjs font-awesome material-ui