The update of Nuxt3 has changed a lot. Please check the version and time before referring to other people's articles.
My nuxt version: 3.0.0, the current time is 2023.7.7
Official website documentation: SEO and Meta · Get Started with Nuxt
On any page, use useHead:
useHead({
title: 'xxxxx',//网站标题
link: [//网站link,可以在这里引入css和icon等
{ rel: 'shortcut icon', href: '/favicon.ico' },
{ rel: 'apple-touch-icon', href: '/favicon.ico' }
]
})
Other methods: Use nuxt.config.ts, which is not recommended because it cannot be changed dynamically. Please refer to the official documentation for how to configure it.
It also supports dynamically changing titles. Since I have no need for this, if you need it, you can check out the documentation here: SEO and Meta · Get Started with Nuxt