[Vuejs]-How to bind fontawesome icon name in Vue.js

0👍

EDIT: I’ve forked the starter template with an app that lets you add an icon by typing in the icon name and then clicking the add button, available here. You’ve provided a limited amount of code that (as far as I can see) has nothing wrong with it, so you can either compare your code with the sandbox or provide more code. Maybe your iconName is returning '' for example.

Original Answer: You need to import which icons that you want to use.

There’s a codesandbox of a good starter template that’s on their GitHub.

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

library.add(faExclamation)

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

Leave a comment