@fortawesome/Angular-Fontawesome和Unicode
我早些时候在Angular应用程序中升级了字体Awessy
。 a href =“/cdn-cgi/l/email-potlection” class =“ __ cf_email__” data-cfemail =“ 6A0B040D1F060B18470C05041E0B1D0B1D0B1D0B1D0F1905070F19070F2A59444444445A4445A”
我们已经从
< i class =“ fa fa-lock”>< i>
to < fa-icon icon =“ falock”></fa-icon>
现在,挑战性的内容是,在我的现有应用程序中,我们使用了 unicode
如下:
ui li:before {
content: '\f138';
font-family: FontAwesome;
}
我已将上述更改为下面,
ui li:before {
content: '\f01';
font-family: Font Awesome 5 Free;
}
但图标没有出现,我们仍然需要定义.css文件在Angular.json为Unicode工作(Node_modules的Fort-tos-tose fort-of-of。
请注意,我的版本
fortawesome 支持
font-awone版本5+`。
添加了软件包
"@fortawesome/angular-fontawesome": "^0.3.0",
"@fortawesome/fontawesome-svg-core": "^1.2.0",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
Angular version :6;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,如果您检查使用新图标的代码,则应该看到类似的内容:
这意味着您没有CSS显示FA图标的方法:
因此您无法使用Unicode的技巧来显示图标。
除非在Angular SVG FA库之上,您可以安装“ Web”方式:
。然后,您将拥有一个常规的
font-family
,您将能够使用。告诉我,如果我正确表达了有关SVG的零件是否对您有意义。
干杯。
Ok, if you inspect your code where you use you new icons, you should see something like that :

That means that you don't have the css way to display FA icons :
So you can't use the unicode trick to display an icon anymore.
Unless, on top of the angular svg FA library, you install the "web" way :
https://fontawesome.com/v5/docs/web/setup/get-started. You will then have a regular
font-family
that you will be able to use.Tell me if the part about the SVG makes sense to you if I expressed it correctly.
Cheers.