i have this html
<div class="input-group-prepend">
<span class="input-group-text" @click="decrement(item)">-</span>
</div>
<input type="text" v-model="item.quantity" class="form-control w-25" aria-label="Product quantity">
<div class="input-group-append">
<span class="input-group-text" @click="increment(item)">+</span>
</div>
It creates an input element like:
When user clicks on '+' or '-' i am calling increment(item) or decrement(item) Vuejs methods, in that methods i am calling updateCart function:
async updateCart(item, quantity){
let q = quantity + item.quantity;
let data = {
quantity: q,
id: item.key
}
let startedQuantity=q;
let json = await axios.post('/cart/change.js', data );
if(json.status === 200){
As you can see in that function i have axios.post call, after that call i am waiting for result and putting the result to json variable. The problem is: when user clicks on + or - multiple times click event is not synchronous, it didn't wait until first click is processed after that process second click. How can i make click event to be synchronous. Thanks
