Support the ongoing development of Laravel.io →
posted 6 years ago
Laravel

I have this line, and everything works as I expect. My data is coming in fine from the Vue ajax request.

<li v-for="item in data"><a v-bind:href='item.id' v-text="item.title"></a></li>

But, the item.id for the href is not complete. I want to add it to the correct location, using a named route.

But this does not work.

<li v-for="item in data"><a v-bind:href="{{route('reViewSingle',['id'=>'item.id'])}}" v-text="item.title"></a></li>

I can hard code the link by doing

v-bind:href="'/re/'+item.id+'/view'"

But then I lose the named route, which I'd prefer to keep.

Can this be done?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Nertskull nertskull Joined 3 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.