vue怎么去掉url参数

如果带参数跳转的页面是tag下的页面时,切换tag不会路由切换,切换tag页时url上的参数还是会在,切换时去掉跳转时带的参数用:

location.replace(location.href.replace(location.hash, `#${this.$route.path}`))
`#${this.$route.path}`里面的#不能去掉
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章