Level 1
Sorry, already fixed:
<div v-for="student in students" v-show="student.id != studentid">
<a :href="'/students/' + student.id + '/edit'">@{{student.name}}</a>
</div>
This works!
4 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm trying to create a href attribute dynamically from a bound vue variable:
<div v-for="student in students">
<a href="/students/ @{{ student.id }} /edit">@{{student.name}}</a>
</div>
If i try this, javascript stops working without any error message. Without the href, this renders fine. Then i tried turning it into an expression, thus:
<a href="@{{ '/students/' + student.id + '/edit' }}">@{{student.name}}</a>
This doesn't break, however all symbols are turned into html symbols and student.id isn't renderd into the actual value:
%7B%7B%20'/student/'%20+%20student.id%20+%20'/edit'%20%7D%7D
So that doesn't work. Turning it into a clickhandler and have Vue do a window.location feels like a bad idea. How should i go about this?
Please or to participate in this conversation.