Seems Like Nested Routes Are Not Working
Closed this issue · 1 comments
aaronksaunders commented
Environment
See information in Stackblitz example
Reproduction
https://stackblitz.com/edit/nuxt-starter-e96dg7?file=pages%2Ffoo.vue
Describe the bug
- with nested routes are not working. It appears that the parent route is being called multiple times causing it to pick up the params that are passed to the child route
Additional context
No response
Logs
No response
Hebilicious commented
Hi @aaronksaunders, thanks for reporting this.
- There's 2 things wrong here, the first one is about the useLoader composable and route parameters, and its being fixed in #45
- The 2nd one is Nuxt behaviour.
pages/foo.vue
will always take precedence overpages/foo/[slug].vue
, so if you want to match thefoo
route differently than thefoo/a
, you need to renamepages/foo.vue
intopages/foo/index.vue
and it will work as expected.