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