Page traduite Le contenu de cette page peut être déprécié.
La propriété globalName
Nuxt nous permet de personnaliser l'identifiant global utilisé dans le template HTML principal ainsi que le nom de l'instance de Vue et d'autres options encore.
-
Type:
String
-
Par défaut:
nuxt
nuxt.config.js
{
globalName: 'monNomPersonnalisé'
}
Le
globalName
doit être un identifiant JavaScript valide, le changer pourrait casser le support pour certains plugins qui dépendent de certaines fonctions basées sur le nom de Nuxt. Si l'on cherche à changer seulement l'identifiant HTML visible __nuxt
, alors on peut utiliser la propriété globals
.The globals property
Personnalise certains noms globaux spécifiques, basés sur
globalName
par défaut.
-
Type:
Object
- Par défaut:
nuxt.config.js
globals: {
id: globalName => `__${globalName}`,
nuxt: globalName => `$${globalName}`,
context: globalName => `__${globalName.toUpperCase()}__`,
pluginPrefix: globalName => globalName,
readyCallback: globalName => `on${_.capitalize(globalName)}Ready`,
loadedCallback: globalName => `_on${_.capitalize(globalName)}Loaded`
},
Editer cette page sur GitHub
Mise à jour le jeu. 9 février 2023

























































