第一步:修改app.vue文件
<template>
<div id="app">
<div class="content">
<router-view v-if="routerAlive">
</router-view>
</div>
</div>
</template>
<script>
export default{
data(){
return{
routerAlive: true,
}
},
provide(){
return{
routerRefresh: this.routerRefresh
}
},
methods:{
routerRefresh(){
this.routerAlive = false;
this.$nextTick(()=>{
this.routerAlive = true;
});
}
}
}
</script>
<style>
</style>
第二步:在页面跳转相应的js文件export default中进行修改
添加一行:
inject: ['routerRefresh']
在跳转方法中修改:
let url = "/getList?ID=" + item.id;
this.$router.push(url);
this.routerRefresh();
|