[Vuejs]-How to change button to disabled once it is clicked in Vue JS app

4👍

Try with:

<button
   type="button"
   class="btn btn-primary btn-lg mb-3 float-right"
   v-on:click="addItem(result)"
   :disabled="result.disableButton">
   <font-awesome-icon icon="plus"/>
</button>

And in your method:

addItem: function(result) {
      result.disableButton = true; // Or result['disableButton'] = true;
      this.List.push(result);
    },
👤mare96

Leave a comment