The globalName property
Nuxt lets you customize the global ID used in the main HTML template as well as the main Vue instance name and other options.
-
Type:
String -
Default:
nuxt
nuxt.config.js
{
globalName: 'myCustomName'
}
The
globalName needs to be a valid JavaScript identifier, and changing it may break support for certain plugins that rely on Nuxt-named functions. If you're looking to just change the visible __nuxt HTML ID, then use the globals property.The globals property
Customizes specific global names which are based on
globalNameby default.
-
Type:
Object - Default:
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`
},
Edit this page on GitHub
Updated at Tue, Jan 25, 2022
Hugo Torzuoli
Sylvain Marroufin
Sébastien Chopin
felipesuri
Kareem Dabbeet
tramplay
Daniel Roe
Clément Ollivier
verebelyicsaba
Adam
Nate Butler
Sandra Rodgers
Arpit Patidar
Matthew Kuehn
Steven DUBOIS
Travis Lindsey
syagawa
Maxime
かる
Al Power
Florent Delerue
José Manuel Casani Guerra
Unai Mengual
kazuya kawaguchi
Michael Lynch
Tomachi
pooya parsa
Shek Evgeniy
Meir Roth
Brett
Adam Miedema
Thomas Bnt
Kazuki Furukawa
Anthony Ruelle
Christophe Carvalho Vilas-Boas
Roman Harmyder
dianhenglau
Michael Gallagher
Jérôme Pott
Bettad