How does vue create global variables

how to create global variables in vue.
refresh the page because of different templates.
so creating a new js and defining something in main that cannot be used will be initialized.
how to create a true global variable?

Aug.16,2021

directly hanging variables on window is true global variable

.
window.msg = 'asd'

of course, vue has many ways to realize data sharing vuex , bus and so on, which is the stupidest of all.


you can use

in main.js.
Vue.mixin({
    data(){
        name:""
    }
})

setup in other groups can be obtained through this.name.


https://www.jianshu.com/p/754.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b33ec6-2b41d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b33ec6-2b41d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?