1

In my project there is a <router-link> that directs to a specific page it looks like this

<router-link to="menugirl" >Plan your visit</router-link>

When you click on the button, this link will be directed to

http://localhost:8080/menugirl/category

The category path that is added at the end of the URL is set by default

And so what is the problem - When I first click on the button and redirect to http: // localhost: 8080 / menugirl / category In this case, this button is present at this address and when I click on this button a second time at http : // localhost: 8080 / menugirl / category it already directs http: // localhost: 8080 / menugirl / menugirl and I only need it to direct to http: // localhost: 8080 / menugirl / category

For a clear understanding, you can look at the demo

<router-link to="menugirl" >Plan your visit</router-link>

enter image description here

1
  • If you're going to use a path, make it absolute. Eg <router-link to="/menugirl">. I highly recommend using named routes instead Commented Apr 20, 2021 at 7:15

1 Answer 1

4

Not sure if I understood the issue but I think that is enough to add a slash in the beginning of the route like this:

<router-link to="/menugirl" >Plan your visit</router-link>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.