this.$router.push()
当跳转到指定页面时,会向history栈添加一个记录,点击后退会返回到上一个页面
this.$router.push('/homesgy')
this.$router.push({path:'/homesgy'})]
this.$router.push({name : 'homesgy'})
this.$router.replace()
当跳转到指定页面时,不会向history栈里面添加记录,而是替换跳转前的页面。点击返回时退回到history栈的上上个页面。
this.$router.replace({path:'./index'})
this.$router. go(n)
跳转到浏览器记录的某一页
// 浏览器记录中当前页面前进一步
this.$router.go(1)
// 浏览器记录中当前页面后退一步
this.$router.go(-1)
// 浏览器记录中当前页面前进五步,如果浏览器没这么多记录,则前进失败
this.$router.go(5)