I have a loop setup like this:
data: {
show: false
}
.test {
hight: 10px;
background-color: red;
}
.test2 {
hight: 15px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div v-for="value in data" :key="value.id">
<div class="test" v-bind:class="{ test2: show }" v-on:click="show = !show">
</div>
</div>
When I click any div
, the height of all the divs changes from 15 to 10 or vice versa.
However, I would like to only change the height of the div
that was clicked. How can I achieve this?