0
点赞
收藏
分享

微信扫一扫

vue 点击按钮 路由跳转指定页面

凌得涂 2023-01-03 阅读 85


最终效果:

点击指定按钮,跳转指定 /login 页面

vue  点击按钮  路由跳转指定页面_跳转页面

代码:

<button @click="gotolink" class="btn btn-success">点击跳转页面</button>

methods:{
gotolink(){

//点击跳转至上次浏览页面
// this.$router.go(-1)

//指定跳转地址
this.$router.replace('/login')
}
}

 

举报

相关推荐

0 条评论