Answer the question
In order to leave comments, you need to log in
How to find element by value in Vue.JS?
I want to make my favorite products for the online store. My problem is that I do not know how to access the desired element in the array by value, but I need this in order for the like to be active.
<i v-if="$store.getters.getAllLikedGood[index][item.id_good]" @click="delLikeGood(item.id_good)" class="icon liked fas fa-heart"></i> . //Закрашенный лайк (Должно появляться если нажали на него)
<i v-bind:class="{ disable: $store.getters.getAllLikedGood[index][item.id_good] }" @click="likeGood(item.id_good)" class="icon-heart far fa-heart"></i> //Не закрашенный лайк (Должно изчезать после нажатия)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question