首页 > 其他 > 详细

vue路由跳转 返回上一级 this.$router.go(-1) 和返回到指定页面this.$router.push('/home')

时间:2018-10-14 18:50:49      阅读:5317      评论:0      收藏:0      [点我收藏+]
1,点击返回上一页
<button @click="goback">goback</button>
methods:{
goback(){}
this.$router.go(-1)
}
2,点击跳转到/Foo2页面
<button @click="ToLink1">goback</button>
ToLink1(){
this.$router.push(‘/foo2‘) 最常用
或者this.$router.push({name:‘Foo1‘})对象的方法
 

vue路由跳转 返回上一级 this.$router.go(-1) 和返回到指定页面this.$router.push('/home')

原文:https://www.cnblogs.com/zyyweb/p/9578392.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!