web小菜菜  


刷新组件
<template>
<router-view v-if="isRouterAlive"/>
</template>
<script>
export default {
data () {
return {
isRouterAlive: true
}
},
methods: {
reload () {
this.isRouterAlive = false
this.$nextTick(() => (this.isRouterAlive = true))
}
}
}
</script>

然后其它任何想刷新自己的路由页面,都可以这样:this.reload()

posted on 2021-03-03 14:11  web小菜菜  阅读(54)  评论(0编辑  收藏  举报