vue 刷新当前页面的方式

在父组件中通过provide来提供变量,然后在子组件中通过inject来注入变量

 

provide(){ return{ reload:this.reload } },

reload(){ this.isRouterAlive = false; this.$nextTick(function(){ this.isRouterAlive = true; }) }

inject:['reload'],

this.reload();

posted @ 2019-12-16 11:15  果果1024  阅读(641)  评论(0)    收藏  举报