我遵循了https://fontawesome.com/how-to-use/on-the-web/using-with/vuejs。
但是当像这样使用它时:
import { library } from '@fortawesome/fontawesome-svg-core'
import { faBars } from '@fortawesome/free-solid-svg-icons'
import { faTwitter, faFacebook, faStackOverflow, faGithub } from '@fortawesome/free-brands-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
...
library.add(faBars, faTwitter, faFacebook, faStackOverflow, faGithub )
Vue.component('font-awesome-icon', FontAwesomeIcon)
...
<font-awesome-icon icon="twitter" class="icon alt"/>
收到:
未找到一个或多个图标 {prefix: "fas", iconName: "twitter"}
vue-fontawesome
的 README讨论了指定除默认的fas
以外的前缀的Vue语法。在这里:https://github.com/FortAwesome/vue-fontawesome#the-icon-property 和 在这里:https://github.com/FortAwesome/vue-fontawesome#why-so-explicit-the-iconfar-coffee-syntax - mwilkerson