Apart from vuex, how can you easily set and get global variables in mpvue?

requirements:
in the original Mini Program, the setting and acquisition of the user"s openId was accomplished through the operation of App.gloabalData . Now using mpvue to develop a new Mini Program, how to deal with this kind of data that needs to be called on multiple pages and does not change much? You can use vuex, but it feels relatively troublesome ~

I hope you can give me some advice, Crab!

Mar.20,2021

values like openid, which will not be changed, can be directly used with the global variable

.
Menu