0

I'm using Laravel - VueJS for one of my projects. But I'm having an issue when clicking the browser back button.

Let me elaborate on my point of concern. I'm using route params to send the data to the next route, as follows:

this.$router.push({ name: 'MY_ROUTE_NAME' , params: {
    'param_one' : this.param_one,
    'param_two' : this.param_two,
    'param_thr' : this.param_thr
}});

Initially, it is working fine but when I'm continuing with such a hierarchical process, when the user is clicking the browser back VueJS is rendering the entire component and not getting the route params at that time.

Is it possible when the user clicks the back button it doesn't render the component freshly? I want to show the component from where it has been left off, with all data that has been set earlier, along with all v-model data.

PRAMIT PAUL
  • 104
  • 1
  • 9
  • I think you should add query params when you visit another route so that when the user go back to the previous page you can get your params from the query – Emtiaz Zahid Apr 08 '21 at 08:31
  • @EmtiazZahid can I pass Objects through query params ? – PRAMIT PAUL Apr 08 '21 at 08:50
  • no, but you can serialize this, here you can see https://stackoverflow.com/questions/6566456/how-to-serialize-an-object-into-a-list-of-url-query-parameters – Emtiaz Zahid Apr 08 '21 at 10:07

0 Answers0