Solutions:

Change the definition of the index file state under the store file

const store = new Vuex.Store({ state:sessionStorage.getItem('state') ? JSON. Parse (sessionStorage.getitem ('state')): {//id skillId: ", // skillStatus: "}})Copy the code

And add in app.vue

mounted() {
            window.addEventListener('unload', this.saveState)
        },
        methods: {
            saveState() {
                sessionStorage.setItem('state', JSON.stringify(this.$store.state))
            }
        }
Copy the code

That is, listen for the unload method, store state into sessionStorage if the page is loaded, and then value state from sessionStorage when needed.