New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple dynamic routes on same level impossible with Nuxt? #2982
Comments
You can do this definitely with a little workaround. Only use one dynamic route, e.g.:
Then, use the |
Trying to figure out practical example, but have no ideas. Right now I am receiving axios.get(`articles/${params.section}`) And axios.get(`articles/${params.section}/${params.slug}`) Any ideas how should I refactor this? Maybe I can provide some Component related ID in my JSON? Fod example: {
"type": "sectionORslug",
"data": ...
} I guess it could work? |
Well, in your case you could nest your dynamic routes because |
Don't get it, how to apply to Nuxt routing? |
Sorry, mislinked! You can see the theory in docs :) In the end, a structure like this may help you:
|
@manniL but then I will have route like this, no? |
@jerakode Yeah, exactly. But how do you get the Yup, the provided structure is similar to what I suggested |
Not sure what you ask. How do I get |
In your current code, this makes sense. But you want it on the same level. If so, how would you find out the |
I have all this data in JSON, I guess. All slugs (articles) are belongs to appropriate sections. Not sure how it can be solved right. OK, what about next. We can have dynamic routes along with static on same level, right? I mean we can have dynamic |
Well, then it might be useful to go for a Exactly, you can use dynamic and static routes on the same level. |
I have the same problem. How to fix it? I need multiple dynamic routes on same level. Could you help me please? |
similar problem pages/_slug.vue
Now I go to the recipes overview, with router-links like recipes/spaghetti But my nav is suddenly replaced from /about, /team turned out I didnt add '/' before the segments in the main nav router-links |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am trying to have such thing:
But looks like it doesn't work with Nuxt.
Is there any way to accomplish this?
The text was updated successfully, but these errors were encountered: