Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm unable to display fontawesome icons in my vuejs app

In my main.js I have:

    import { library } from '@fortawesome/fontawesome-svg-core'
    import { faUserSecret } from '@fortawesome/free-solid-svg-icons'
    import { faFontAwesome } from '@fortawesome/free-brands-svg-icons'
    import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

    library.add(faUserSecret)
    library.add(faFontAwesome)


    Vue.component('font-awesome-icon', FontAwesomeIcon)

In my component I have

     <button class="btn btn-secondary" type="button">
          <font-awesome-icon :icon="['fa', 'fa-search']" />
          <font-awesome-icon :icon="['fas', 'user-secret']" />
     </button>

And I only see the second icon...what am I doing incorrectly here?

like image 625
BostonMacOSX Avatar asked Nov 17 '25 13:11

BostonMacOSX


1 Answers

I think instead of:

<font-awesome-icon :icon="['fa', 'fa-search']" />

it should be:

<font-awesome-icon :icon="['fa', 'search']" />

like image 70
T. Short Avatar answered Nov 20 '25 07:11

T. Short



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!