Discussion
Discussion copied to clipboard
Select checkbox where conditions met.
I have the list of users and I want to show the checkboxes selected if the user.id = people.user_id.How can I do this.It shows me checkboxes repeated.
<div class="checkbox checkbox-inline" v-for="user in freelancer"> <p v-for="people in peopleOnProject"> <input type="checkbox" id="{{user.id}}" value="{{user.id}}" v-model="checkedNames" :checked="people.user_id === user.id"> <label for="{{user.id}}"> {{user.name}} </label> </p> </div>
Did you every find a way to achieve something like this?
I ended up using something like this
selected="{{ varA == varB ? 'true' : undefined }}"