LoginSignup
4

More than 3 years have passed since last update.

FontAwesomeを使おうとしたら、Could not find one or more icon(s) というエラーが出た話

Last updated at Posted at 2019-04-15

概要

FontAwesomeをVue.jsに入れようとした。
他のアイコンでも使えるか試したところ、Could not find one or more icon(s) というエラーが出た。

FontAwesomeの入れ方

入れ方は、こちらの記事を参照
https://fontawesome.com/how-to-use/on-the-web/using-with/vuejs

エラーの詳細

スクリーンショット 2019-04-15 13.31.28.png

解決策

prefixを変更する。

Before

font-awesome-icon(icon='envelope' )

After

font-awesome-icon(:icon="['far', 'envelope']" )

解説

FontAwesomeのアイコンには、複数のスタイルが用意されている。
それぞれ、違うprefixを指定する必要がある。

例:

Prefix Style
fas Solid
far Regular
fal Light
fab Brand

参考:https://fontawesome.com/how-to-use/on-the-web/setup/getting-started

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4