最终效果:
点击指定按钮,跳转指定 /login 页面
代码:
<button @click="gotolink" class="btn btn-success">点击跳转页面</button>
methods:{
gotolink(){
//点击跳转至上次浏览页面
// this.$router.go(-1)
//指定跳转地址
this.$router.replace('/login')
}
}
vue 点击按钮 路由跳转指定页面
阅读 86
2023-01-03
点击指定按钮,跳转指定 /login 页面
<button @click="gotolink" class="btn btn-success">点击跳转页面</button>
methods:{
gotolink(){
//点击跳转至上次浏览页面
// this.$router.go(-1)
//指定跳转地址
this.$router.replace('/login')
}
}
相关推荐
精彩评论(0)