Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using vue-font-awesome to display a facebook icon in a Vue CLI application

i tried this-

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

    library.add(faFacebook)

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

But apparently there's no faFacebook in free-svg-icons. How to include the facebook icon?

like image 240
Darth Spider Avatar asked Jul 06 '18 15:07

Darth Spider


2 Answers

I faced the same problem. Solved with this:

terminal:
npm install --save @fortawesome/free-brands-svg-icons

main.js:
import { faFacebook } from '@fortawesome/free-brands-svg-icons'
library.add(faFacebook)

inside code:
<font-awesome-icon :icon="{ prefix: 'fab', iconName: 'facebook' }"/>
like image 174
Zilvinas Baltrunas Avatar answered Nov 06 '22 21:11

Zilvinas Baltrunas


check the fontawesome-free-brands for faFacebookSquare

import { faFacebookSquare, faFacebookMessenger } from '@fortawesome/fontawesome-free-brands';

does that work?


edit

just saw that faFacebookF is available there too, I just missed it

import { faFacebookF } from '@fortawesome/fontawesome-free-brands';

like image 41
Daniel Avatar answered Nov 06 '22 22:11

Daniel