Within my template, I have a select field:
li(v-for="user in users", :id="'user_' + user.id")
.user-management(@click="toggleShowUser(user)", :id="'user' + user.id")
select(v-model="selected" :options="options")
In my Vue component:
export default {
data() {
return {
options: [
{
value: 'option1',
label: 'Option 1',
iconLeft: 'user'
},
],
selected: ['option1']
},
toggleShowUser(user) {
this.$set(this.selected, 0, "5ad0ac33a8abbc3fe4ce2863")
}
}
}
The issue is that the this.selected
value is being set in all user select fields within the template.
I am looking to set this value specifically in a user's select field with a specific id.
Appreciate any help on this!