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)
- [Vuejs]-Reference an external JavaScript file using Vue.js
- [Vuejs]-Fill table with vue js 3 and composition API
Source:stackexchange.com