我已经从nativescript核心文档中阅读了以下代码。
<Image src="font://" stretch="none" class="fas"></Image>
我想使用Image标签显示图标,但是当我尝试使用 NATIVESCRIPT-VUE 上一个代码时,什么都没有出现。
我的代码如下:
<Label text="hola" textWrap="true" />
<Label class="fas" style="font-size: 50em; color: red" text.decode="" />
<Label class="fas" style="font-size: 50em; color: blue" text.decode="" />
<Label class="far" style="font-size: 50em; color: orange" text.decode="" />
<Label class="fab" style="font-size: 50em; color: black" text.decode="" />
<Image src="font://" stretch="none" class="fas"></Image>
带有标签标签的图标可以完美地工作。但是,带图标的图像标签无效。
文档链接:Here
这是我的项目结构
PlayGround示例:Link
答案 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="" />
<Image src.decode="font://" stretch="none"
class="fas">