1

it was working before in vue2 but now i don't know what's the problem!

main.js

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

const app = createApp(App)

// Import Font Awesome Icons
import { library } from '@fortawesome/fontawesome-svg-core'
import { faUserSecret } from '@fortawesome/free-solid-svg-icons'
// import {  } from '@fortawesome/free-brands-svg-icons'
// import { } from '@fortawesome/free-regular-svg-icons'

library.add(faUserSecret)

app.use(store).use(router).mount('#app')

// Use Components
app.component('font-awesome-icon', FontAwesomeIcon)

Vue

<font-awesome-icon icon="user-secret"></font-awesome-icon>

1 Answer 1

1

Make sure you got the right version of vue-fontawesome! I was having the same problem and installing version 3.x of the vue-fontawesome package solved it for me. It can be installed with NPM as follows:

$ npm i --save @fortawesome/vue-fontawesome@prerelease

Since Vue 3 is still in prerelease at the time of writing, this installation is bound to change in the future. Please check the official Github repo for up to date information.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much, your answer was the only one that I worked for me!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.