vue 刷新当前页面的方式
在父组件中通过provide来提供变量,然后在子组件中通过inject来注入变量
provide(){ return{ reload:this.reload } },
reload(){ this.isRouterAlive = false; this.$nextTick(function(){ this.isRouterAlive = true; }) }
inject:['reload'],
this.reload();
在父组件中通过provide来提供变量,然后在子组件中通过inject来注入变量
provide(){ return{ reload:this.reload } },
reload(){ this.isRouterAlive = false; this.$nextTick(function(){ this.isRouterAlive = true; }) }
inject:['reload'],
this.reload();