NuxtN
Nuxt7mo ago
5 replies
dankell.

Nesting multiple dynamic routes in Nuxt

I am currently in the process of scoping out a migration of our current Web Application to Nuxt 4, trying to figure out what works of the current design, and what might end up being a breaking change.

I am currently looking at the routing, and would like confimation that my thinking is correct.

Each section of the application follows the same general pattern, where we have a Search Page, followed by the search result, which might have serval pages.

The following is the example route for teh Job section

pages
  - jobs
    - job
      - [id]
        - [id].vue
        - summary.vue
        - internal.vue
        - external.vue
  [jobs].vue

The route \jobs\ correctly shows the [jobs].vue component

I am assuming that if I want to get content from jobs\job\[id]\ to show then I will need to add a <NuxtPage \> to [jobs].vue and have a v-if based on route to decide if I am targeting \jobs or a route below

Is that correct?
Was this page helpful?