Nativescript-vue字体图标-图像标签

时间:2020-01-08 18:19:40

标签: nativescript nativescript-vue

我已经从nativescript核心文档中阅读了以下代码。

<Image src="font://&#xf51e;" stretch="none" class="fas"></Image>

我想使用Image标签显示图标,但是当我尝试使用 NATIVESCRIPT-VUE 上一个代码时,什么都没有出现。

我的代码如下:

<Label text="hola" textWrap="true" />
<Label class="fas" style="font-size: 50em; color: red" text.decode="&#xf7aa;" />
<Label class="fas" style="font-size: 50em; color: blue" text.decode="&#xf51e;" />
<Label class="far" style="font-size: 50em; color: orange" text.decode="&#xf2bb;" />
<Label class="fab" style="font-size: 50em; color: black" text.decode="&#xf2b3;" />
<Image src="font://&#xf51e;" stretch="none" class="fas"></Image>

带有标签标签的图标可以完美地工作。但是,带图标的图像标签无效。

文档链接:Here

这是我的项目结构

enter image description here

PlayGround示例:Link

1 个答案:

答案 0 :(得分:1)

您缺少fas的CSS定义

.fas {
    font-family: "Font Awesome 5 Free", "fa-solid-900";
    font-weight: 900;
}

有效!

<Label class="fas" style="font-size: 50em; color: red"
                text.decode="&#xf7aa;" />
<Image src.decode="font://&#xf7aa;" stretch="none"
                class="fas">

Updated Playground