ebd63647 by zhaoqian

重新加载局部刷新

1 parent 08543a78
<template>
<div id="app">
<router-view />
<router-view v-if="isRouterAlive" />
</div>
</template>
<script>
export default {
provide(){
return{
reload:this.reload
}
},
data(){
return{
isRouterAlive:true,
}
},
mounted() {
window.addEventListener("unload", this.saveState);
},
......@@ -13,6 +23,12 @@ export default {
saveState() {
sessionStorage.setItem("state", JSON.stringify(this.$store.state));
},
reload(){
this.isRouterAlive = false;
this.$nextTick(function () {
this.isRouterAlive = true;
})
},
},
};
</script>
......
......@@ -277,6 +277,7 @@
Qlr,
Qlxz,
},
inject:['reload'],
data () {
return {
lx:"zrz",
......@@ -484,7 +485,7 @@
// this.form.xmmc=this.$store.xmmc;
this.form.zrzbsm=this.$route.query.bsm;
this.getZddm(this.$store.zdbsm);
this.getZrzDetailByBsm(this.$route.query.bsm)
}else {
this.bsm=this.$route.query.bsm;
this.form.zrzbsm=this.$route.query.bsm;
......@@ -494,7 +495,17 @@
this.getZrzDetailByBsm(this.$route.query.bsm)
}
},
mounted() {}
mounted() {},
computed: {
zrzbsm() {
return this.$store.state.zdbsm;
},
},
watch:{
zrzbsm:function (val) {
this.reload()
}
}
}
</script>
<style rel="stylesheet/less" lang="less" scoped>
......