Answer the question
In order to leave comments, you need to log in
How to make correct software navigation on NUXT?
Good afternoon, tell me please.
Let's say I have a catalog with products, each product has its own id in json.
When I click on a product, I go to the product card, where I have a specific path to it. (Let's say the url has become app/catalog/1, etc.)
And I need the ability to go to this product card not only from the catalog (So that if I enter app/catalog/1, the product card opens).
Tell me how to do it more competently, there is an option through router.push, but as far as I understand, I will not be able to go to this card outside the page where such a method is declared.
Thank you in advance!)
Answer the question
In order to leave comments, you need to log in
You will be able to access it from anywhere on the site.
1. nuxt-link or router.push to app/catalog/id from anywhere.
2. in hooks, for example, asyncData, is taken from the id url and a request is sent to the back to get the data of this catalog element.
3. profit.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question