1、核心代码
this.$router.push({name: 跳转到的页面的名字, params: 参数})
2、代码示例
本页面要跳转的方法
gotoHis (data) {
if (data.length > 5) {
let param = {truckName: data[0], startTime: data[5], endTime: data[6]}
this.$router.push({name: 'area-truckGpsHistoryTrail', params: param})
}
}
truckGpsHistoryTrail页面对应的处理方式
activated () {
this.truckName = this.$route.params.truckName
this.startTime = this.$route.params.startTime
this.endTime = this.$route.params.endTime
if (this.truckName && this.startTime && this.endTime) {
this.getTruckTrail()
}
}