vue fontawesome npm code example
Example 1: installing fontawesome vue project
npm install --save-dev @fortawesome/fontawesome-free
import '@fortawesome/fontawesome-free/css/all.css' <------
import '@fortawesome/fontawesome-free/js/all.js' <------
.
.
.
new Vue({ router, store, render: h => h(App),}).$mount('#app')
<i class="fab fa-2x fa-facebook"></i>
<i class="fab fa-2x fa-twitter"></i>
<i class="fab fa-2x fa-instagram"></i>
Example 2: npm font awesome vue
npm install @fortawesome/fontawesome-svg-core
npm install @fortawesome/free-solid-svg-icons
npm install @fortawesome/vue-fontawesome
import {library} from '@fortawesome/fontawesome-svg-core'
import {fas} from '@fortawesome/free-solid-svg-icons'
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
library.add(fas);
Vue.component('font-awesome-icon', FontAwesomeIcon)