点击按钮实现路由的跳转
<div @click="gotoMenu">按钮</div>
实现跳转
methods: {
gotoMenu(){
//跳转到上一次浏览的页面 this.$router.go(-1)
this.$router.go(-1)
//指定跳转的地址 this.$router.replace('/menu')
this.$router.replace('/menu')
//指定跳转的路由的名字下 this.$router.replace({name:'menu'})
this.$router.replace({name:'menu'})
//通过push进行跳转
this.$router.push('/menu')
}
},
}
转载于:https://www.cnblogs.com/chz1905/p/10954227.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)