Abhilash
Abhilash

Reputation: 2953

How to access id from a nested route in nuxt

In my nuxt app the nested url looks like this.

http://lvh.me:8001/categories/:id/sections/:id

http://lvh.me:8001/categories/40/sections/12

How can I access the categories id from this page? $route.params.id only returns the id of sections which is 12. Is there a way to access the id of categories?

Upvotes: 0

Views: 403

Answers (1)

gab
gab

Reputation: 124

you have to change the parameter name they can't use same name

http://lvh.me:8001/categories/:id1/sections/:id2

Upvotes: 2

Related Questions