9
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Nuxt.jsで日本語設定(lang属性を変更)にする方法

Last updated at Posted at 2020-02-08

Nuxt.jsでは、nuxt.config.jsでlang属性を変更することが可能です。
vue.JPG

nuxt.config.jsのheadに下記コードを追記します。

htmlAttrs:{ lang: 'ja'}

全体としては下記のようになります。

nuxt.config.js
head: {
    htmlAttrs:{
      lang: 'ja'
    },
    title: process.env.npm_package_name || '',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
    ],
  }

これでNuxt.jsでlang属性を変更することができます。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?