Translated page Contents of this page might be outdated.
A propriedade head
O Nuxt permite você definir todos os atributos meta padrão para sua aplicação dentro do ficheiro nuxt.config.js
, usando a mesma propriedade head
-
Tipo:
Object
ouFunction
nuxt.config.js
export default {
head: {
titleTemplate: '%s - Nuxt',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
// hid é usado como identificador único. Não use o `vmid` para isso visto que isso não funcionará
{ hid: 'description', name: 'description', content: 'Meta description' }
]
}
}
Para conhecer a lista de opções que você pode atribuir ao head
, consulte a documentação do vue-meta .
Você pode também usar o head
como uma função dentro de seus componentes para acessar os dados do componente através do this
(leia mais ).
Para evitar marcação meta duplicadas quando for usada dentro de um componente filho, defina um identificador único com a chave
hid
para os seus elementos meta (leia mais ).
Edit this page on GitHub
Updated at Thu, Feb 9, 2023

























































