Nativescript vue字体图标-图像标记
我已经阅读了nativescript核心文档中的以下代码Nativescript vue字体图标-图像标记,nativescript,nativescript-vue,Nativescript,Nativescript Vue,我已经阅读了nativescript核心文档中的以下代码 <Image src="font://" stretch="none" class="fas"></Image> 我想使用图像标记来显示图标,但是当我使用NATIVESCRIPT-VUE尝试前面的代码时,什么也没有出现 我的代码如下: <Label text="hola" textWrap="true" /> <Label class="fas" style="fon
<Image src="font://" stretch="none" class="fas"></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>
带有标签标签的图标非常完美。但是,带有图标的图像标记不起作用
文档链接:
这是我的项目结构
操场示例:您缺少
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">
您缺少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">
在我这方面效果非常好,请确保已将字体复制到字体文件夹中。如果您仍然有问题,请共享一个游乐场示例。您正在使用nativescript vue吗?它在nativescript Core中运行良好我只是添加了palyground示例它在我这方面运行良好,请确保您已将字体复制到字体文件夹中。如果您仍然有问题,请共享一个游乐场示例。您正在使用nativescript vue吗?它在nativescript coreI中运行良好,只需添加palyground样本即可。这是真的。我也忘了src.decode。谢谢这是真的。我也忘了src.decode。谢谢