MrT*_*ken 5 reactjs material-ui
我正在使用Material UI,并且有以下内容:
import IconButton from 'material-ui/IconButton';
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-right" tooltipPosition="bottom-right" />
Run Code Online (Sandbox Code Playgroud)
当我测试工具提示时,图标没有显示,但工具提示在悬停时显示。有人可以帮我创建一个例子吗?我是否缺少图标 URL?
这似乎是 Material-UI 文档的问题。检查这个链接了解更多详细信息
\n\n如果你想放置 github 图标,那么你可以尝试使用 SVG 图标。看来你必须在你的index.html 中包含谷歌材料图标样式表才能使其工作。
\n\n<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">\nRun Code Online (Sandbox Code Playgroud)\n\n一般来说,如果我们想使用 svg 图标,我会按照下面的方式进行。
\n\nimport IconButton from \'material-ui/IconButton\';\nimport Remove from \'material-ui/svg-icons/Content/remove\';\n\n<IconButton tooltip="Hide" style={{float: \'right\'}} iconStyle={{marginTop: -25, color: myTheme.color}} onClick={this.removeMinus}>\n <Remove color=\xe2\x80\x9cred\xe2\x80\x9d />\n</IconButton>\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
9925 次 |
| 最近记录: |