防止 fontawesome 的 svg 翻译 [英] Prevent svg translation of fontawesome

查看:32
本文介绍了防止 fontawesome 的 svg 翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了角度和字体很棒的问题.在第一代图标列表中,所有基于 css 类的图标突然都转换为 svg.它只影响实心图标.例如:

I have en issue with angular and font awesome. On first generation of list of icons suddenly all css class based icons are translated to svg. It affects only solid icons. for example :

<i class="fas fa-2x fa-minus-square"></i>

不知何故被翻译成

<svg _ngcontent-c16="" class="svg-inline--fa fa-minus-square fa-w-14 fa-2x"
 ng-reflect-ng-class="fas fa-2x fa-minus-square" aria-hidden="true" data-prefix="fas" data-icon="minus-square"
 role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg="">
    <path fill="currentColor"
      d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM92 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H92z">
    </path>
</svg>
<!-- <i _ngcontent-c16="" class="fas fa-2x fa-minus-square" ng-reflect-ng-class="fas fa-2x fa-minus-square"></i> -->

有什么办法可以避免这种情况吗?强制翻译?

Is there any option which can prevent this situation? Force somehow translation?

这可能有问题.例如,我不能使用实心图标 :(

It can be problematic. For example I cannot use solid icons :(

推荐答案

如果您不希望 Font Awesome 自动将看起来像图标的 <i> 标签替换为相应的 <svg>s,你可以更改配置禁用 autoReplaceSvg.

If you'd like Font Awesome not to automatically replace <i> tags that look like icons with the corresponding <svg>s, you could change the configuration to disable autoReplaceSvg.

如果您通过

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆