Skip to content
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

Seems Like Nested Routes Are Not Working #44

Closed
aaronksaunders opened this issue Aug 27, 2023 · 1 comment · Fixed by #45
Closed

Seems Like Nested Routes Are Not Working #44

aaronksaunders opened this issue Aug 27, 2023 · 1 comment · Fixed by #45
Labels
bug Something isn't working

Comments

@aaronksaunders
Copy link

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

@aaronksaunders aaronksaunders changed the title Seems Like Neste Routes Are Not Working Seems Like Nested Routes Are Not Working Aug 27, 2023
@Hebilicious Hebilicious added the bug Something isn't working label Aug 28, 2023
@Hebilicious
Copy link
Owner

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 fix: dynamic parameters route loaders #45
  • The 2nd one is Nuxt behaviour. pages/foo.vue will always take precedence over pages/foo/[slug].vue, so if you want to match the foo route differently than the foo/a, you need to rename pages/foo.vue into pages/foo/index.vue and it will work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants