<li class="cart_item clearfix" v-for="(product, index) in products" :key="index">
<div class="cart_item_text"><button type="button" class="btn btn-success" name="button" @click="increaseQuantity(index)"</button></div></li>
This loop iterates over three products and calls the 'increaseQuantity' method three times.
//script
methods: {increaseQuantity(index) {this.$store.dispatch("incrementQuantity", index);},}
//store.js
mutations:{
INCREMENT(state, index) {state.basket.items = state.basket.items.map(items => {state.basket.items[index].quantity +=1;return items;});},},
actions:{
incrementQuantity({ commit }, index) {commit("INCREMENT", index)},}