Answer the question
In order to leave comments, you need to log in
Request caching on route change in vue js?
When switching from one route to another (submit forms -> list of elements), a request goes to the server, but the old data is not updated. When I reload the page, the list comes updated.
I call it in the component like this:
created () {
this.$store.dispatch('getTasks')
},
Answer the question
In order to leave comments, you need to log in
Old data comes because it has not yet been updated on the server - the request is asynchronous.
I don’t know how you send a request with a submit, but first you need to wait for a response, and only then go to another route.
Use router hooks .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question