this.$router.push
跳轉到指定url路徑,並想history棧中添加一個記錄,點擊后退會返回到上一個頁面
// 字符串
this.$router.push('index')
// 對象
this.$router.push({path: 'login-pw'})
// 帶參數
this.$router.push({path: 'login-pw', query: {'account': this.account.account}})
// 跳轉后的頁面獲取參數
this.account.account = this.$route.query.account
this.$router.replace
跳轉到指定url路徑,但是history棧中不會有記錄,點擊返回會跳轉到上上個頁面
this.$router.go(n)
向前或者向后跳轉n個頁面,n可為正整數或負整數