最终效果:

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

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

代码:

<button @click="gotolink" class="btn btn-success">点击跳转页面</button>
 methods:{
        gotolink(){

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

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

 

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2021-04-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2023-03-09
  • 2022-12-23
相关资源
相似解决方案