Vuex stores information, and after refreshing the page, the data is gone. Is there any way to keep the data?

in fact, there are two questions, please advise
1: vuex dispatch getUserInfo, normally no problem, after refreshing the page, there is no way to get the data. Is there any way to solve this problem and save the local cache? no, no, no. If you save the local cache. Then why use vuex.

2: it is also a problem with vuex. I use .mapGetters (["getUserInfo"]) to jump to the page in computed, the data is normal, but use

    computed: {
    getUserInfo:function(){
      return this.$store.getters.getUserInfo
    }
  }

this is empty. Please tell me the difference between the mapGetters mapping and the this.$store method

Thank you all for your advice.

Mar.12,2021

take the userInfo and save a copy in the Local Storage, and then take the value of Local Storage
and put it in the vuex when the page loads. Ensure access to Synchronize.


vuex is also used to store only a global variable, when the page refreshes, the global variable naturally does not exist.
user information is recommended to be stored in localStorage to store a
localStorage.setItem (key, value) / / storage data. Value is of string type. If you want to save an object, first convert
localStorage.getItem (key) / / to get data


second question return this.$store.getters.getUserInfo
change it to return this.$store.getters ['getUserInfo']

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-1b33e5c-2b64a.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-1b33e5c-2b64a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?