【发布时间】:2021-02-25 22:09:06
【问题描述】:
我是 vue-router 的新手,我正面临这个问题。 这是我的代码;
filter() {
this.$router.push({
query: {
bathrooms: this.selectedBathroom,
beds: this.selectedBed,
minPrice: this.selectedMinPrice,
maxPrice: this.selectedMaxPrice,
minLandSize: this.selectedMinLandSize,
maxLandSize: this.selectedMaxLandSize,
minLotSize: this.selectedMinLotSize,
maxLotSize: this.selectedMaxLotSize,
minYear: this.selectedMinYear,
maxYear: this.selectedMaxYear,
},
})
}
当用户点击过滤器按钮时,过滤器方法被运行。但是数据没有更新,当用户返回上一页时,查询参数被删除,但数据没有更新。 他们是我可以解决这个问题的方法吗?
【问题讨论】:
-
你能澄清更多吗?,当你说数据没有更新时,你指的是参数吗?
-
我正在根据 params 值发出服务器请求。因此,当调用该方法时,我希望更新来自服务器的数据。
标签: vue.js vue-router router