File based routing groups and index renaming #393
Replies: 3 comments 5 replies
-
In the docs you sent the |
Beta Was this translation helpful? Give feedback.
-
I'd also love to see route grouping like is available in SolidStart and SvelteKit (their grouping docs). I'd also love to be able to enforce directory only routes like SvelteKit opted for. In the directory-only scenario, you would not be allow to have the following: - pages/
- index.vue
- films.vue
- actors.vue and instead would have to do: - pages/
- index.vue
- films/
- index.vue
- actors
- index.vue I realise this is probably not desirable as a default for vue-router's file based configuration, but it would be nice to have the option to enforce this. Having worked on several Vue, Nuxt, and SvelteKit projects I've personally found it a lot easier to mentally parse the routes/pages folders when I know a directory always maps to a route. In the linked SvelteKit docs you'll see this also enables you to easily have different layouts for different groups. (I realise vue-router doesn't have quite the same concept of a 'layout' as SK's |
Beta Was this translation helpful? Give feedback.
-
FYI I added this to the board. I think the groups serves multiple purposes and it will also help with issues like |
Beta Was this translation helpful? Give feedback.
-
I really like what solid-start is doing with their file based routing. They've got a concept of renaming index files using
()
. So/nested/index.vue
could be/nested/(child).vue
instead. Any chance that something like this might make it into the file based routing?https://docs.solidjs.com/solid-start/building-your-application/routing#renaming-index
Update
Posva has added this to the board. Track it at #448.
Beta Was this translation helpful? Give feedback.
All reactions