Closed MickL closed 9 months ago
Added a PR that should support using name
Since you're translating the routes /services/advanced
(and other routes) don't exist, you can view the paths using devtools to confirm this.
You can pass the route name to the to
prop instead of a path, same for localePath
:
<NuxtLinkLocale to="services-advanced">Link</NuxtLinkLocale>
or
localePath('services-advanced')
Wow this actually works. So my PR is not needed. I didnt know it is workign because it is documented to use localePath({ name: 'about' })
I understand it's a bit unclear, feel free to open a PR to expand the docs instead! 😄
Made a PR to update the docs :)
Thanks!
@BobbieGoede How do named routes work with dynamic routes?
E.g. from you website:
pages/
├── blog/
├──── [date]/
├────── [slug].vue
How can I use this with localePath()
or <NuxtLinkLocale>
? I will update the docs when I know how it works :D
@BobbieGoede
Environment
Reproduction
https://stackblitz.com/edit/github-5pbsy2?file=pages%2Findex.vue,layouts%2Fdefault.vue
Describe the bug
<NuxtLinkLocale>
does not seem to work with a nested custom path.For example:
Additional context
Maybe it is actually not a bug but is missing the
name
propLogs
No response