Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

NuxtLink and Vue router duplicate routes

I use nuxt 3

I have a navigation bar, it has NuxtLink with the attribute :to.

Links have a dynamic route category/${slug}/

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The problem is that the :to attribute does not overwrite the current navigation, but adds it to the end of the current one, like that category/${slug}/category/${slug}/

If I use the usual to attribute, then everything is fine.

Why is this happening and how to fix it?

>Solution :

Just remove last "/".

category/${slug} <== OK

category/${slug}/ <== Not OK

/category/${slug} <== OK

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading