vue路由跳轉 返回上一級 this.$router.go(-1) 和返回到指定頁面this.$router.push('/home')


1,點擊返回上一頁
<button @click="goback">goback</button>
methods:{
goback(){}
this.$router.go(-1)
}
2,點擊跳轉到/Foo2頁面
<button @click="ToLink1">goback</button>
ToLink1(){
this.$router.push('/foo2') 最常用
或者this.$router.push({name:'Foo1'})對象的方法
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM