标签:his div 调用 引用 lse app turn route def
1、修改App.vue
<template>
<div id="app">
<router-view v-if="isRouterAlive"></router-view>
</div>
</template>
<script>
export default {
name: "app",
provide() {
return {
reload: this.reload
}
},
data() {
return {
isRouterAlive: true
};
},
methods: {
reload() {
this.isRouterAlive = false;
this.$nextTick(function() {
this.isRouterAlive = true;
})
}
}
}
</script>
2、到需要刷新的页面引用
export default {
inject: ["reload"],
data() {
return {
}
},
methods: {
//调用
this.reload()
}
}
标签:his div 调用 引用 lse app turn route def
原文地址:https://www.cnblogs.com/zjxiang008/p/12167961.html