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

Vue <a> tag href attribute splicing

My current url is http://localhost:8080/component, and in this page I have an <a> tag

<a :href="'/detail/' + comp._id"></a>

When comp._id is determined, for example it is 6221add333182348e1d70104.

I want the URL to jump to http://localhost:8080/component/detail/6221add333182348e1d70104 when I click on the link.

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

But actually it is http://localhost:8080/detail/6221add333182348e1d70104.

How can I achieve this ?

>Solution :

You can add /component/to your link. Like: <a :href="'/component/detail/' + comp._id"></a>

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