6

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?

Darth Spider
  • 98
  • 1
  • 9
  • I answered a similar question few hours ago, check it, maybe it helps: https://stackoverflow.com/questions/51207263/fontawesome-error-could-not-find-one-or-more-icon/51208634#51208634 – yuriy636 Jul 06 '18 at 16:04
  • Thanks yuri! Had to use fab prefix. – Darth Spider Jul 06 '18 at 16:37

2 Answers2

12

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' }"/>
2

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';

Daniel
  • 34,125
  • 17
  • 102
  • 150