Answers for "how to use font awesome icons in vuejs"

2

installing fontawesome vue project

//install fontawesome icons
npm install --save-dev @fortawesome/fontawesome-free

//inside main.js add
import '@fortawesome/fontawesome-free/css/all.css'     <------
import '@fortawesome/fontawesome-free/js/all.js'    <------
.
.
.
new Vue({  router,  store,  render: h => h(App),}).$mount('#app')


// you can now use the icons anywhere in your project with the <i>
   <i class="fab fa-2x fa-facebook"></i>
   <i class="fab fa-2x fa-twitter"></i>
   <i class="fab fa-2x fa-instagram"></i>
Posted by: Guest on November-01-2020
0

add font awesome to vue

// import required libraries
npm install --save @fortawesome/fontawesome-svg-core 
npm install --save @fortawesome/free-solid-svg-icons
npm i --save @fortawesome/vue-fontawesome@prerelease

//in main.js include the following
import { library } from '@fortawesome/fontawesome-svg-core';
import { fas } from '@fortawesome/free-solid-svg-icons';
library.add(fas);

//include the fontawesome icons in the createApp function 
createApp(App).use(store).use(router).mount('#app').component('fa', FontAwesomeIcon);
Posted by: Guest on July-18-2021
0

vue font awesome icons

$ npm i --save @fortawesome/fontawesome-svg-core
$ npm i --save @fortawesome/free-solid-svg-icons
Posted by: Guest on January-27-2021
0

vue font awesome icons

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

library.add(faUserSecret)

Vue.component('font-awesome-icon', FontAwesomeIcon)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  components: { App },
  template: '<App/>'
})
Posted by: Guest on January-27-2021
0

vue font awesome icons

<template>
  <div id="app">
    <font-awesome-icon icon="user-secret" />
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>
Posted by: Guest on January-27-2021
0

vue font awesome icons

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

library.add(faUserSecret)
Posted by: Guest on January-27-2021

Code answers related to "how to use font awesome icons in vuejs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language