LoginSignup
0
0

More than 3 years have passed since last update.

Nuxt.js + VuetifyでFontAwesomeを使用する

Posted at

Nuxt.jsでVuetifyを使用するときに、Vue.jsのときのようにplugins/vuetify.jsがなくどこで設定すればいいのか迷ったのでメモ。

FontAweSomeをインストール

ここは公式通り。

yarn add @fortawesome/fontawesome-free -D
// OR 
npm install @fortawesome/fontawesome-free -D

nuxt.config.jsに追加

nuxt.config.jsvuetifyに以下を追加

nuxt.config.js
   vuetify: { 
++   defaultAssets: {icons: 'fa'}
     customVariables: ['~/assets/variables.scss'], 
     theme: { 
      dark: true, 
       themes: { 
         dark: { 
           primary: colors.blue.darken2, 
           accent: colors.grey.darken3, 
           secondary: colors.amber.darken3, 
           info: colors.teal.lighten1, 
           warning: colors.amber.base, 
           error: colors.deepOrange.accent4, 
           success: colors.green.accent3 
         } 
       } 
     } 
   }, 

これでOK。

<v-icon>fas fa-pen</v-icon>
0
0
0

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
0
0