如何将Font Awesome的IconDefinition转换为Kendo UI的SVGIcon

huangapple go评论71阅读模式
英文:

How to convert Font Awesome IconDefinition to Kendo UI SVGIcon

问题

Kendo UI 最近默认开始使用 SVG 图标在它们的小部件中 (链接), 但它们的图标选择不太理想。我想要使用FontAwesome图标,但它们有不同的变量类型。我应该如何做?

英文:

Kendo UI recently just moved to using SVG icons by default in their widgets (link), but their selection of icons is not very good. I would like to use FontAwesome icons instead, but they have different variable types. How can I do this?

答案1

得分: 1

我联系了Telerik的支持团队,他们帮助了我:

我的代码

import { SVGIcon } from '@progress/kendo-svg-icons';

import { faHouse } from '@fortawesome/pro-regular-svg-icons';

public faHouse: SVGIcon = {
    name: faHouse.iconName,
    content: `<path d="${faHouse.icon[4]}" />`,
    viewBox: `0 0 ${faHouse.icon[0]} ${faHouse.icon[1]}`,
};

他们的Stackblitz演示

英文:

I reached out to Telerik's support and they helped me:

My Code

import { SVGIcon } from &#39;@progress/kendo-svg-icons&#39;;

import { faHouse } from &#39;@fortawesome/pro-regular-svg-icons&#39;;

public faHouse: SVGIcon = {
    name: faHouse.iconName,
    content: `&lt;path d=&quot;${faHouse.icon[4]}&quot; /&gt;`,
    viewBox: `0 0 ${faHouse.icon[0]} ${faHouse.icon[1]}`,
};

Their Stackblitz Demo.

huangapple
  • 本文由 发表于 2023年6月8日 21:57:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76432622.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定