首先你需要装一个项目依赖
npm i vuex-persistedstate -S
然后在你的store里面的index引入
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)
然后在你的const store = new Vuex.Store({ 里面写上
plugins: [createPersistedState()],
然后就是正常的vuex的取值和调用
然后你的存储的页面调用
this.$store.commit('键名',值)
然后在你需要取出的页面
...mapState(["键名"])