Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NuxtLinkLocale behaves differently than NuxtLink for external links #2272

Closed
TitusKirch opened this issue Jul 29, 2023 · 0 comments · Fixed by #2273
Closed

NuxtLinkLocale behaves differently than NuxtLink for external links #2272

TitusKirch opened this issue Jul 29, 2023 · 0 comments · Fixed by #2273

Comments

@TitusKirch
Copy link
Contributor

Environment

  • Operating System: Linux
  • Node Version: v16.20.0
  • Nuxt Version: 3.6.5
  • Nitro Version: 2.5.2
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: extends, i18n
  • Runtime Modules: -
  • Build Modules: -

Reproduction

<NuxtLink to="http://localhost:8080/">
  NuxtLink http://localhost:8080/
</NuxtLink>
<NuxtLinkLocale to="http://localhost:8080/">
  NuxtLinkLocale http://localhost:8080/
</NuxtLinkLocale>

Describe the bug

I would also expect NuxtLinkLocale to behave like NuxtLink for an external link and not simply redirect to '/'. Otherwise you would have to build an extra component that checks if it is an external link and then uses NuxtLink or NuxtLinkLocale (and the whole point of NuxtLinkLocale was that you don't have to build your own component).

Output:

<a href="http://localhost:8080/" rel="noopener noreferrer">
  NuxtLink http://localhost:8080/
</a>
<a aria-current="page" href="/" class="router-link-active router-link-exact-active">
  NuxtLinkLocale http://localhost:8080/
</a>

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants