K
K
killwayne2019-11-29 17:40:27
JavaScript
killwayne, 2019-11-29 17:40:27

How to give the necessary dynamic route in nuxt depending on the server response, if they are nearby?

Good afternoon everyone!
I have such a file structure and it must be strictly adhered to

/catalog
  _category
  _subcategory

Depending on the result of the server response, I need to return the appropriate page.
How to implement this if two dummy routes lie side by side?
Thank you very much!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
VegasChickiChicki, 2019-11-29
@VegasChickiChicki

https://ru.nuxtjs.org/guide/dynamic-routes/
I did not understand what the problem is, in extreme cases you can transfer it through the store.

R
Rodion Moon, 2019-11-30
@GONGOTA

You're having trouble because of the wrong architecture. Why do you have a category and a subcategory on the same level, when it should be like this: category -> subcategory. And then you can make a reference to the same component and just check if the parameter existssubcategory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question