Where is the value of store.state for Vuex?

We know that the state value of vuex will be emptied when the browser is refreshed. I thought that the value could be stored in the local database, so what should vuex"s state do to get the corresponding value from cookie or other localized places when refreshing the browser?

Mar.12,2021

haven't you saved it in the local database? before initializing state, you should first check whether there is a value in the local database. If so, initialize the database value for state. Do you think this is the case? If you save
, you can directly take out the value of state, serialize it into a string, store it in localStorage, initialize and read the string from localStorage when refreshing and open, and deserialize it to object initialization to state


const store = new Vuex.Store({
  // 
  state: {
    headImg: JSON.parse(sessionStorage.getItem('headImg')) || ""
  },
  mutations: {
    newImg(state, msg){
      sessionStorage.setItem('headImg', JSON.stringify(msg))
      state.headImg = msg;
    }
  }
})
.
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-1b37f70-2b921.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-1b37f70-2b921.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?