// app.vue
<router-view v-if="isRouterAlive" />
data() {
return {
isRouterAlive: true,
};
},
methods: {
reload() {
this.isRouterAlive = false;
this.$nextTick(function () {
this.isRouterAlive = true;
});
},
},
provide() {
return {
reload: this.reload,
};
},
inject: ["reload"],
this.reload()