Vue returns to the previous page with parameters

Return to the previous page using the

this.$router.go(-1)


Then you can only put the parameters in localStorage before returning

localStorage.setItem('searchKeyword', this.keyword)


After returning to the previous page, get the data, and then clear the localStorage

 let searchKeyword = localStorage.getItem('searchKeyword')
 
 localStorage.setItem('searchKeyword', '')
 
reference link

Guess you like

Origin blog.csdn.net/Ruiqi8/article/details/129428994