/search
新网址应该是
/search?foo=bar
由于页面上应用了某些过滤器,我只想更新相同路径上的查询参数
我的代码:
this.$router.push({query: params})
[有一种方法可以使用catch块来处理“ NavigationDuplicated”错误,但只能抑制该错误,路由中的查询参数仍不会更新。
相关问题:
How to use router.push for same path, different query parameter in Vue.js
但是这给出了路径'/',但我需要保持在同一页面上
当前URL为/ search,新URL应为/ search?foo = bar由于页面上应用了某些过滤器,我只想更新查询参数,使其位于同一路径上。我的代码:this。$ ...
catch
来解决此错误:this.$route.name
停留在当前路线上: