[Vuejs]-How do increment value while it being declared inside function

0👍

what i understood from your question, this should work for you.

increment: function(e) {
  e.preventDefault();
  var codeForRef = e.srcElement.id;

  var test = parseInt(this.$refs[codeForRef][0].value, 10); //the value of the qty
  test += this.dyQty //whatever it needs to go up in
  this.$refs[codeForRef][0].value = test;
 }

Leave a comment