字体很棒的类映射到角度导入定义

发布于 2025-01-25 02:17:13 字数 564 浏览 2 评论 0原文

https://fontawesome.com/icons/

在搜索图标时,它会给您提供类别的课程HTML,但角需要使用ICONDEFINITION。

例如:

< i class =“ fa-solid fa-star”></i>

将是angular:

< fa-icon [icon] =“ ['fas','star']”></fa-icon>

我如何找出网站上发现的图标的iCondefinition?

我找到了项目中的定义列表,但它并没有真正帮助将其映射到网站上的图标。

iCondefinitions的列表

https://fontawesome.com/icons/

When searching for an icon it gives you the class to enter into the HTML, but angular requires to use the icondefinitions.

for example:

<i class="fa-solid fa-star"></i>

Would be the following with angular:

<fa-icon [icon]="['fas','star']"></fa-icon>

How do I figure out the icondefinition for the icons I find in the website?

I have found the list of definitions in the project, but it doesn't really help mapping it to the icon on the site.

List of icondefinitions

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

却一份温柔 2025-02-01 02:17:13

我能够直接使用“ FA-Solid FA-Diamond”课程使其上班。

我从数据阵列中汲取了这个问题,并通过这样的变量将其拉入:

<a class="{{data.icon}}"></a>
    {
        routeLink: '/tabletopcreator/dashboard',
        icon: "fa-solid fa-diamond",
        label: 'Tabletop Creator',
    }

这起作用了,因为我将其添加到index.html

<script src="https://kit.fontawesome.com/98f07d8644.js" crossorigin="anonymous"></script> 

I was able to get it to work using the class directly "fa-solid fa-diamond".

I was pulling this from an data array and pulled it in via a variable like this:

<a class="{{data.icon}}"></a>
    {
        routeLink: '/tabletopcreator/dashboard',
        icon: "fa-solid fa-diamond",
        label: 'Tabletop Creator',
    }

This worked because i added this to the index.html

<script src="https://kit.fontawesome.com/98f07d8644.js" crossorigin="anonymous"></script> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文