the problem is that there is an input box on the page to enter the purchase quantity, but after the purchase is successful, you want to clear this input box:
question:
after emptying the box, it will automatically prompt to verify the error message, but do not want to do so, how to deal with it?
as follows:
<input type="text" name="quantity" v-validate=""required|qtyRule"" v-model.trim="qty" :placeholder="">
the following code simulates the user action:
this.qty = 10;//10
setTimeout(() => {
this.qty = "";//5s
//
//console.log(this.errors)
//console.log(this.$validator.errors)
//this.$validator.remove("quantity")
}, 5000);
add:
feels that this.$validator
and this.errors
are all delay objects. When debugging, this
, this.$validator
, this.errors
all return undefined
, but the console has output!