[Vuejs]-How to create fontawesome local template in vue js?

0👍

I solved this problem by creating a Vue plugin. Hope this help.

Icon.js

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

export default {
  install(Vue){
     library.add(faUserSecret)
     Vue.component('FaIcon', FontAwesomeIcon)
  }
}

main.js
import Icon from '/path/to/Icon.js'
.
.
.

app.use(Icon)

Leave a comment