LoginSignup
1
0

More than 1 year has passed since last update.

Nuxt3でhead情報を追加する方法

Last updated at Posted at 2022-11-09

まず、useHeadを使う方法

useHead({title:'xxx'});

次、nuxt.config.tsを使う方法(の参考サイト)

以下、サンプル。

import { defineNuxtConfig } from 'nuxt'

// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
    ssr:true,
    app:{
        head: {
          title: "My Blog",
          meta: [
            { charset: "utf-8" },
            { name: "viewport", content: "width=device-width, initial-scale=1" },
          ],
          link: [
            { rel: "icon",type: "image/x-icon", href: "/favicon.ico" }, 
            {rel: "stylesheet",href:                         "https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"}
          ],
        },
      }

})
1
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
1
0