Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue 3 global variable

// on vue 3

const app = Vue.createApp({})
app.config.globalProperties.$myGlobalVariable = globalVariable

// on vue 2
Vue.prototype.$myGlobalVariable = globalVariable
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vue #global #variable
ADD COMMENT
Topic
Name
9+3 =