vue刷新子组件

一.通过v-if

<template>
//调用Flow子组件
<Flow :propId="propId" v-if="isRouterAlive"></Flow>
</template>
<script>
<!--  引入Flow子组件-->
import Flow from '../dynamic/test'
export default {
 data () {
   return {
     isRouterAlive: true
   }
 },
 components: {
      Flow
    },
 methods: {
<!--  定义刷新方法-->
   reload () {
     this.isRouterAlive = false
     this.$nextTick(() => (this.isRouterAlive = true))
   }   
 }
}
</script>
二.然后其它任何想刷新自己的路由页面,都可以这样:

<!--  调用刷新子组件的方法-->
this.reload() 
原文地址:https://www.cnblogs.com/huoyz/p/14632076.html