[Vuejs]-Javascript clear all input when changing dropdown value

0👍

The clearing code goes in your autofillResults method, called when the select changes. You clear the input by clearing the variable that stores it’s value. Don’t try to do anything directly on the input. The input should be the dumb reflection of it’s variable.

0👍

You can empty text fields inside autofillResult() like below,

autofillResult: function(item){
  //add all text fields here
  this.instruction.price = "";
}

Leave a comment