-
-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: custom routes not analyzed in layer with custom
srcDir
(#3133)
- Loading branch information
1 parent
5caa83b
commit b9e5296
Showing
5 changed files
with
51 additions
and
5 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
13 changes: 13 additions & 0 deletions
13
specs/fixtures/layers/layer-pages-custom-src-dir/nuxt.config.ts
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,13 @@ | ||
// https://nuxt.com/docs/guide/directory-structure/nuxt.config | ||
export default defineNuxtConfig({ | ||
srcDir: 'src/app/', | ||
i18n: { | ||
customRoutes: 'config', | ||
pages: { | ||
'custom-layer/[slug]': { | ||
en: '/custom-layer/[slug]', | ||
fr: '/custom-layer-french/[slug]' | ||
} | ||
} | ||
} | ||
}) |
22 changes: 22 additions & 0 deletions
22
specs/fixtures/layers/layer-pages-custom-src-dir/src/app/pages/custom-layer/[slug].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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts" setup> | ||
const { locales } = useI18n() | ||
const switchLocalePath = useSwitchLocalePath() | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<h1>Hello from custom page!</h1> | ||
<section id="lang-switcher-with-nuxt-link"> | ||
<strong>Using <code>NuxtLink</code></strong | ||
>: | ||
<NuxtLink | ||
v-for="(locale, index) in locales" | ||
:id="`nuxt-locale-link-${locale.code}`" | ||
:key="index" | ||
:exact="true" | ||
:to="switchLocalePath(locale.code)" | ||
>{{ locale.name }}</NuxtLink | ||
> | ||
</section> | ||
</div> | ||
</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