I am trying to implement a basic button that adds an item to a list:
<label for="numit">item number:</label>
<input type="text" id="numit" :value="idxItemBuy">
<button id="buyitem" @click="buy($event.target.value)">Buy</button>
buy() {
console.log("buy function")
this.currentPlayer.buy(this.idxItemBuy)
}
However, the method 'buy' is not being called as expected (and I'm uncertain about when to use $event.target.value).