adbrosaci / vue-lang-router

Vue language routing with (optional) localized URLs.
MIT License
66 stars 8 forks source link

<localized-link> show "real" URL in generated <a>? #15

Closed GregoryWullimann closed 3 years ago

GregoryWullimann commented 3 years ago

Hi

I noticed that by using <localized-link> the generated URL in the <a> tag is the "global" one and not the one with the language. This maybe could give SEO/Crawling problems with Google?

For example I have and /about page.

If I'm on / and have a <localized-link> to /about, it is fine.

If I'm on /fr/ and have a <localized-link> to /about, the generated link in the anchor tag will be /about and not /fr/about, even if by clicking it correctly go to the fr page.

It's there a workout to generated the "correct" url?

Edit:

Just saw the example and it works like I wanted, but it's using <localized-link to="..."> while I'm using

<localized-link :to="{name: 'product', params: { id: id }}">

so I guess I need to pass it in the params?

radek-altof commented 3 years ago

Hi @GregoryWullimann, yes, this is known issue, I haven't gotten around to fixing it yet, sorry 🙁

Duplicate of #9.