How to empty the input value cache for V-model bindings
In Vue+bootstrap+jquery frame your project, the action button formatter the formatted cell in the list is bound to the bootstrap modal box, and in the Modal box popup page, after binding a value with V-model, Click on the Modal box with the Close modal box button to close the modal box, the next time you click on the action button in the list, after the modal box pops up, the input field in the page will cache the last value after gaining and losing focus.
When you empty the binding value:
1 <input type= "text" id= "Apttrain" class= "Form-control" placeholder= "Train" v-model.trim= "apttrain" @change = "Querytrain (' EndStation1 ')" @focus = "clear" >
You can add a focus event to input to determine if the bound value is empty and then empty the value
1Clearfunction () {2 varthat = This;3 //that.ticketgate = null;4 //$ (' #ticketGate '). Val (');5 if(That.ticketgate! =NULL|| That.ticketgate! = "){6That.ticketgate =NULL;7$ (' #ticketGate '). Val (' ');8}Else{9 Ten } One if(That.apttrain! =NULL|| That.apttrain! = "){ AThat.apttrain =NULL; -$ (' #aptTrain '). Val (' '); -}Else{ the - } - -}
Vuejs and jquery using V-model bound values in build projects cannot be emptied