vue2.0在使用的过程中, .vue文件之间的跳转,在template中的常见写法是:
<router-link to="/miniCard/statement/horizon"> <button class="btn btn-default colorDe">继续</button> </router-link>
但是有时的需求是页面不直接跳转,有确认弹框或者其他事件,此时就需要在js中设置跳转,常用的一种方法是 .$router.push ,用法如下:
this.$router.push({path: ‘/…’}); path为跳转路径