I am working on a gomoku style game using Vue.js, and I am stuck. When one of the buttons is clicked, it should change the background-color of that button to green, then if I click on another open spot, it should change the background-color to blue (thereby simulating each player's move). The problem with my program so far is that when I click on a button, it changes every empty spot to green instead of just the one I clicked. I am trying to do this in my index.html:
<ul>
<li v-for="slots in board">
<ul id="board">
<li v-for="slot in slots">
<button @click="handleClick($index, $parent.$index)"
:class="{'green': turn}"
>{{slot}}</button></li>
</ul>
</li>
</ul>
Then in my styles.css:
.green{
background-color: #41B883;
}
.blue{
background-color: #35495E;
}