Nested routes in <router-view/> #449
Replies: 1 comment 2 replies
-
What I did to get more specific use cases like yours working is using the The way I did this exact use case was by looking in SvelteKit's book (https://kit.svelte.dev/docs/advanced-routing#advanced-layouts-page), and replace all slashes that come before an Lastly, if your routing is starting to get too many edge cases, I would just recommend taking the edge cases out of your routing structure and import them as regular components where you require them. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I have the following directory/file structure for routes:
Inside
index.vue
I have a<router-view>
where I want to display thecreate.vue
inside as a nested route. But show singular object details page separately.I am trying to understand how to achieve this from the docs and other discussions but I don't believe they describe the same use case: https://uvr.esm.is/guide/file-based-routing#nested-routes
Additionally, from other locations I want to be able to display the "create object" page inside a
<router-view/>
This is so that I can implement a URL structure such as:
/objects/create-object
/resource/create-object
/blobs/create-object
I don't want to have duplicate the "create object" page for each directory.
The docs mention having a seperate
objects.vue
alongside theobjects
directory to achieve nesting, however I can't see how this achieves nesting for a specific sub route of the index.This is the outcome I would like to achieve in standard router format:
Beta Was this translation helpful? Give feedback.
All reactions