-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from serkodev:feat/index-fallback
feat: index-fallback
- Loading branch information
Showing
9 changed files
with
60 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup lang="ts"> | ||
const relativePath = computed(() => { | ||
return useRoute().path.replace(/^\/examples\/parallel-routes/, '') || '/' | ||
}) | ||
</script> | ||
|
||
<template> | ||
<TheBoundary label="$__PAGES_PATH__" class="p-4"> | ||
<p class="mb-4"> | ||
This is the index view of the @left parallel routes. | ||
</p> | ||
|
||
<p class="my-4"> | ||
The reason of rendering this view because when the page is init loaded but cannot find the match routes for <code class="text-nuxt">{{ relativePath }}</code>. | ||
</p> | ||
|
||
<p> | ||
Instead of render this <code class="text-nuxt">/~index</code> path, you can set the <NuxtLink to="/getting-started/configuration#index"> | ||
<code class="text-nuxt underline">index</code> | ||
</NuxtLink> in config, so it will redirect to the index page of the parallel routes. | ||
</p> | ||
</TheBoundary> | ||
</template> |
2 changes: 1 addition & 1 deletion
2
...parallel-sidebar/pages/@left/~default.vue → ...s/parallel-sidebar/pages/@left/~index.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<template> | ||
<ExampleView label="$__PAGES_PATH__"> | ||
default fallback path | ||
@left index fallback | ||
</ExampleView> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<ExampleView label="$__PAGES_PATH__"> | ||
@main index fallback | ||
</ExampleView> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters