I have a list of items and icons which I want to toggle. How should I do that? Right now my click affects all of the items.
<ion-item
v-for="course in courses"
:key="course.id">
<ion-label class="ion-text-wrap">{{ course.name }}</ion-label>
<span @click="toggleIcons">
<ion-icon v-if="isSelected" :icon="ellipseOutline" slot="end"></ion-icon>
<ion-icon v-else :icon="checkmarkCircleOutline" slot="end"></ion-icon>
</span>
</ion-item>
///
data() {
return {
isSelected: false,
}
},
methods: {
toggleIcons(){
this.isSelected = !this.isSelected
}
}