vue 刷新当前页面的方式

Posted 1024l

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue 刷新当前页面的方式相关的知识,希望对你有一定的参考价值。

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

 

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

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

inject:[‘reload‘],

this.reload();

以上是关于vue 刷新当前页面的方式的主要内容,如果未能解决你的问题,请参考以下文章