vue中keep-alive,include的缓存问题

1.app.vue




2.store.js

import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    keepAlive: []
  },
  mutations: {
    SET_KEEP_ALIVE: (state, keepAlive) => {
      state.keepAlive = keepAlive
    }
  },
  getters: {
    keepAlive: state => state.keepAlive
  }
})

3.第一个页面.vue


4.第二个页面.vue


你可能感兴趣的:(Vue)