Sample app for adding fontawesome to your Vue CLI project more easily.
- Font Awesome now has an official Vue.js component that's available for all who want to use our icons in their Vue.js projects. (show details)
- based on Font Awesome 5 Vue component
- No CSS file required
yarn install
<template>
<div>
<font-awesome-icon :icon="['fab', 'font-awesome']" size="1x" class="icon" />
<font-awesome-icon :icon="['fab', 'github']" size="1x" class="icon" />
</div>
</template>
<script>
// fontawesome
// https://github.com/FortAwesome/Font-Awesome/tree/master/js-packages/%40fortawesome
// https://github.com/FortAwesome/vue-fontawesome
import Vue from 'vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons'
import { far } from '@fortawesome/free-regular-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(fas)
library.add(far)
library.add(fab)
Vue.component('font-awesome-icon', FontAwesomeIcon)
</script>