Skip to content

Commit

Permalink
docs: add info about dynamic nested routes (#22862)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hebilicious committed Aug 28, 2023
1 parent d905e5f commit bfd0658
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/2.guide/2.directory-structure/1.pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ if (route.params.group === 'admins' && !route.params.id) {
</script>
```

::alert{type="info"}
Named parent routes will take priority over nested dynamic routes. For the `/foo/hello` route, `~/pages/foo.vue` will take priority over `~/pages/foo/[slug].vue` . Use `~/pages/foo/index.vue` and `~/pages/foo/[slug].vue` to match `/foo` and `/foo/hello` with different pages,.
::

## Catch-all Route

If you need a catch-all route, you create it by using a file named like `[...slug].vue`. This will match _all_ routes under that path.
Expand Down

0 comments on commit bfd0658

Please sign in to comment.