docs: add info about dynamic nested routes (#22862)

This commit is contained in:
Heb 2023-08-28 15:34:47 +07:00 committed by GitHub
parent d905e5f519
commit bfd06589fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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.