From bfd06589fdc6d062596e27059135be7337391815 Mon Sep 17 00:00:00 2001 From: Heb Date: Mon, 28 Aug 2023 15:34:47 +0700 Subject: [PATCH] docs: add info about dynamic nested routes (#22862) --- docs/2.guide/2.directory-structure/1.pages.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/2.guide/2.directory-structure/1.pages.md b/docs/2.guide/2.directory-structure/1.pages.md index 079cd39827..dec282c074 100644 --- a/docs/2.guide/2.directory-structure/1.pages.md +++ b/docs/2.guide/2.directory-structure/1.pages.md @@ -134,6 +134,10 @@ if (route.params.group === 'admins' && !route.params.id) { ``` +::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.