如何在react.js,尤其是社交图标中使用字体上的6个图标?
我从字体很棒的文档中安装了以下软件包,并添加了facoffee
图标,但是当我想使用社交图标时,不会添加图标。
npm i --save @fortawesome/fontawesome-svg-core
npm i --save @fortawesome/free-solid-svg-icons
npm i --save @fortawesome/free-regular-svg-icons
npm i --save @fortawesome/react-fontawesome@latest
<FontAwesomeIcon icon={faCoffee} />
I installed the below package from font awesome documentation and faCoffee
icon was added but when I want to use the social icon the icon is not added.
npm i --save @fortawesome/fontawesome-svg-core
npm i --save @fortawesome/free-solid-svg-icons
npm i --save @fortawesome/free-regular-svg-icons
npm i --save @fortawesome/react-fontawesome@latest
<FontAwesomeIcon icon={faCoffee} />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
社交图标随附Fontawesome的Pro Package,因此您需要升级才能获取它们。我相信他们也有自己的包裹。
但是,如果您选择通过脚本标签导入图标而不是React软件包,则可以免费访问图标,例如...
如果需要的话,脚本标签:
Social icons come with with pro package of FontAwesome, so you will need to upgrade in ordered to get them. I believe they come in their own package too.
However, if you chose to import your icons via the script tag rather than the react packages, you can access the icons for free like so...
Script tag if you need it: