How to set URL query params in Vue with Vue-Router

前端 未结 9 795
梦如初夏
梦如初夏 2020-12-23 20:24

I am trying to set query params with Vue-router when changing input fields, I don\'t want to navigate to some other page but just want to modify url query params on the same

9条回答
  •  無奈伤痛
    2020-12-23 20:54

    I normally use the history object for this. It also does not reload the page.

    Example:

    history.pushState({}, '', 
                    `/pagepath/path?query=${this.myQueryParam}`);
    

提交回复
热议问题