vue中使用vuex緩存組件

在app.vue中,使用keep-alive,它的屬性include,來緩存組件 配合使用vuex,來添加需要緩存的組件 在需要做緩存的組件內使用 1,引入vuex 2,觸發mutations 裏的 addCachePage 方法, this.$store.commit(‘addCachePage’, ‘test’); 3,注意:組件的name:‘test’必須帶上, 4,移除緩存觸發mutati
相關文章
相關標籤/搜索