this.$route和this.$router的區別

做項目的時候發現傳參數是通過 this.$route.query或者 this.$route.params接收router-link傳的參數。 在路由跳轉的時候除了用router-link標籤以外需要在script標籤在事件裏面跳轉,所以有個方法就是在script標籤裏面寫this.$router.push('要跳轉的路徑名'),還有this.$router.go(-1)返回上一頁面  在寫的時候
相關文章
相關標籤/搜索