import { provide} from "vue";
<router-view v-if="isRouterAlive"></router-view>
let globeData = reactive({
isRouterAlive: true
})
function reload () {
globeData.isRouterAlive = false;
nextTick(function () {
globeData.isRouterAlive = true;
})
}
provide('reload', reload);
// 刷新的组件
import { inject} from "vue";
let iload = inject('reload');
watch(route, () => {
iload();
})