I'd like to clear all the errors from vee-validate in a sign out method, following code seems not working, the errors in the form is still being shown, why?
sign_out: function (e) {
console.log('sign me out')
var self = this
firebase.auth().signOut().then(function () {
console.log('sign out!')
self.info.email = ''
self.errors.clear() // clear errors object of vee-validate
}, function (error) {
console.log('sign out failed')
})
},
here is a jsFiddle that describe the problem in code, when you type '123', a warning is shown, then when you click 'clear', the field is set to '', and errors.clear(), was expecting the warning in the form will go away, but it is not:
https://jsfiddle.net/8j3z82bv/1/
A validation error occurs when you have validation/response checking turned on for one of the questions and the respondent fails to answer the question correctly (for numeric formatting , required response).
All you need is to add the v-validate directive to the input you wish to validate and make sure your input has a name attribute for error messages generation. Then, pass to the directive a rules string which contains a list of validation rules separated by a pipe ' | '.
Verification and validation (also abbreviated as V&V) are independent procedures that are used together for checking that a product, service, or system meets requirements and specifications and that it fulfills its intended purpose. These are critical components of a quality management system such as ISO 9000.
I have come up with another solution that could help. in your input we'll add another listener so it will be like this:
<input type="email" name="email" v-model="info.email" v-validate="'required|email'" @input="validate">
then will add the validate function that call vee-validate function so your vue instance will be something like this:
var app = new Vue({
el: '#app',
data: {
info: { email: '' }
},
methods: {
onSignin: function (e) { },
clear_proc: function (e) {
delete this.info.email
this.errors.clear()
},
validate: function () {
this.$validator.validateAll();
}
}
})
Version (3.x)
this.$refs.observer.reset();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With