Add global variable in Vue.js 3

The most direct replacement is app.config.globalProperties. See: https://vuejs.org/api/application.html#app-config-globalproperties So: Vue.prototype.$myGlobalVariable = globalVariable becomes: const app = createApp(RootComponent) app.config.globalProperties.$myGlobalVariable = globalVariable This is scoped to a particular application rather than being global as it was with Vue.prototype. This is by design, all ‘global’ configuration options are now scoped to an application. The relevant RFC is here: … Read more