axios.get('http://127.0.0.1:8000/api/filter-trip?fromlocation='+this.form.from_place+'&tolocation='+this.form.to_place+'&assign_date='+DatabaseFormat+'',auth)
.then(response => {
this.FilterTripData = response.data
console.log(this.FilterTripData)
this.$router.push({ path : '/search-bus', params: {
items: this.FilterTripData
}});
})
.catch(error => {console.log(error)});
}
Pass Api如何通过Router Push获取数据并在另一页上访问这些数据
this.$router.push({ path : '/search-bus', params: {
items: this.FilterTripData
}});
这已经是正确的。要在另一个页面中访问它。
this.$router.currentRoute.params.items