[Vuejs]-NUXT pass object data into pages with path

3πŸ‘

βœ…

I’m assuming you have gone through this: https://router.vuejs.org/api/.

You can just pass the entire object:

<nuxt-link :to="{ path: 'test', query: {a: 1, b: 2}}">Test Page</nuxt-link>

And your URL will become something like this:

http://localhost:3000/test?a=1&b=2

The entire object can be simply passed.

This will be available to your next page in $route object in the url query.

Otherwise if you don’t want to get your deal object exposed just use the concepts of vuex. Store the entire deal object in the vuex and pass ids to different pages. And from pages retrieve the deal object through vuex.

πŸ‘€Helper

Leave a comment