Search code examples
nativescriptfont-awesomenativescript-vue

Using FontAwesome with Nativescript-Vue


I'm just not succeeding in using FontAwesome icons in my Nativescript-Vue app. If I just want to use a regular icon, it works fine:

<Label col="0" text.decode="&#xf279;" class="fa"></Label>

But when I want a Solid (or I suppose any of the others), no love.

<Label col="0" text.decode="&#xf5da;" class="fa fas"></Label>

I've looked at so many instructions now that my eyes are crossed. Today I upgraded to v5. But I don't thing I was able to get the solid ones to work before.


Solution

  • Nothing I tried from the V5 instructions seemed to work. (Maybe someone can write explicit instructions for using in Nativescript-Vue.)

    But, falling back to the old way, the simple

    <Label col="0" text.decode="&#xf5da;" class="fas"></Label>
    

    with

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

    And, I must have somehow been interupted when I first set this up, because fa-solid-900 was not actually in my [app.fonts][1] folder. :-|

    Not sure what all those fancy new packages I installed will do now.