I just want to throught POSTS and USERINFO at the same pace, in a way that in show the right user avatar for a given post
posts : {!! $posts !!},
userinfo : {!! $userinfo !!},
< v-cloak v-for="post in posts">
<div v-bind:style="{ backgroundImage: 'url(' + post.picture + ')' }">
<a href="{{-- url("#" v-bind:style="{ backgroundImage: 'url(' + userinfo.avatar + ')' }"></a>
</div>
Dont know how... basicly...
The correct way (IMHO) is to provide the data to the template in a correct way, so the template just loops through the data the least amount of time.
To support that a computed
value may be the easiest way to implement.
You can create a complex loop using js in you computed value, and then you reduce any complex logic in the template. This may also reduce the number of renders or re-computations needed if other parts of the component or template are changing.
other options are to update data.variable using a watch or from an api callback