LoginSignup
8
7

More than 3 years have passed since last update.

NuxtでGoogle Fontsを使う方法が簡単過ぎた

Posted at

ポートフォリオサイトでGoogle Fontsを使おうと思い、
cssでimportしたり、linkタグでやってみたりしたけど、
多分、これが一番簡単なのではないかと思います。

インストール

nuxt-webfontloader

npm install nuxt-webfontloader

設定方法

nuxt.config.js
  /*
   ** Nuxt.js modules
   */
  modules: [
    'nuxt-webfontloader'
  ],
  webfontloader: {
    google: {
      families: ['Noto+Sans+JP']
    }
  },

以上、確認してみましょう。

npm run dev
8
7
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
8
7