Page traduite Le contenu de cette page peut être déprécié.
La Propriété head
Nuxt vous permet de définir toutes les métadonnées par défaut pour votre application dans le fichier nuxt.config.js.
-
Type:
Object
orFunction
nuxt.config.js
export default {
head: {
titleTemplate: '%s - Nuxt',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
// hid is used as unique identifier. Do not use `vmid` for it as it will not work
{ hid: 'description', name: 'description', content: 'Meta description' }
]
}
}
Pour connaître la liste des options que vous pouvez donner à head
, consultez la documentation vue-meta .
Vous pouvez également utiliser head
comme fonction dans vos composants pour accéder aux données des composants avec this
(en savoir plus ).
Pour éviter la duplication des métadonnées dans le composant enfant, configurez un identifiant unique avec la clé
hid
pour vos balises méta (en savoir plus ).
Editer cette page sur GitHub
Mise à jour le jeu. 9 février 2023

























































