繁体   English   中英

Angular:Google Material Icons无法呈现

[英]Angular: Google Material Icons not rendering

在Angular项目中,Google材质图标在chrome中运行良好,但在chrome隐身模式firefox中无法呈现。 index.html下面,行用于获取字体库。

  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

在模板中:

<mat-icon>person</mat-icon>

而不是图标,它将人显示为文本。 在浏览器的网络选项卡中,它显示307临时重定向作为两个请求的状态代码。

以下是在浏览器中输出:
在此输入图像描述

你必须使用:

<i class="material-icons">3d_rotation</i>
<i class="material-icons">person</i>

用于 :

<mat-icon svgIcon="person" aria-hidden="false"></mat-icon>
<mat-icon svgIcon="password" aria-hidden="false"></mat-icon>

参考: https//material.angular.io/components/icon/overview

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM