[Vuejs]-Pass data to next route with vue

0👍

You can use query or url parameters between routes with the vue router. However, the data is now exposed in the url and you will now inherit all limitations from url requirements such as length and type (url encoded string).

A couple solutions are more applicable for your issue :

  1. As you mentioned you could trigger a subsequent request if the first call is successful.
  2. Emit the data to the destination view/route (note that the data can only flow up or down the component tree)
  3. (Preferred) Use a state management tool like vuex to centralize your data. You will only need to update (mutate) your data (state) once and it will be available anywhere within your application. The time investment for this solution is not negligeable, however on a longer term it can simplify your application significantly.

Leave a comment