vue路由跳转 this.$router.go()


1.返回上一页

<button @click="goback">返回上页</button>
methods:{
  goback(){
    this.$router.go(-1)
  }
}

2.返回到指定页

<button @click="goToLink">返回page1</button>
methods:{
  goToLink(){
    this.$router.push('/page1')
}

或这样写

this.$router.push({name:'page1'})

原文:https://blog.csdn.net/qq_25533359/article/details/88567640


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM