1创建一个js文件
import { mapGetters } from "vuex";
export default function () {
return {
computed: mapGetters(['keepAliveList']),
activated() {
let that = this;
let refresh = true;
this.keepAliveList.map(item => {
if (item == that.$route.fullPath) refresh = false;
});
try {
if (refresh && that.refresh)
that.refresh();
} catch (error) {
console.log('keepAliveManage:页面刷新失败')
}
},
created() {
this.$store.commit('ADD_KEEPALIVE_PATH', this.$route.fullPath);
},
beforeDestroy() {