router.push 当 path 相同时,log 打印错误捕

2020-04-09  本文已影响0人  Volcaner

https://stackoverflow.com/questions/57837758/navigationduplicated-navigating-to-current-location-search-is-not-allowed

router.push('your-path').catch(err => {})
const path = `/products/${id}`
if (this.$route.path !== path) this.$router.push(path)
上一篇 下一篇

猜你喜欢

热点阅读