我正在使用 Material UI ,我有以下几点:
import IconButton from 'material-ui/IconButton';
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-right" tooltipPosition="bottom-right" />
当我测试工具提示时,图标没有显示,但工具提示在悬停时显示。有人可以帮我创建一个例子吗?我错过了图标 URL 吗?
最佳答案
这似乎是 Material-UI 文档的问题。检查这个 Link更多细节
如果你想放置 github 图标,那么你可以尝试使用 SVG Icon。看来您必须在 index.html 中包含 google material icons 样式表才能使其工作。
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
通常,如果我们想使用 svg 图标,我会按照以下方式进行。
import IconButton from 'material-ui/IconButton';
import Remove from 'material-ui/svg-icons/Content/remove';
<IconButton tooltip="Hide" style={{float: 'right'}} iconStyle={{marginTop: -25, color: myTheme.color}} onClick={this.removeMinus}>
<Remove color=“red” />
</IconButton>
关于reactjs - Material UI <IconButton> 未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48302581/