0

I have a Vue JS form using Vee Validate, I have a method set up where I'd like to make a particular input field valid whenever the method runs. The method runs after a button is pressed:

/**
         * Use email suggestion
         */
        setEmailSuggestion: function preventScreenAutoLock(suggestion) {
          this.formData.AppEmail = this.formData.AppEmail + suggestion
        }

I'm not sure how to go about doing this, I essentially need to remove the validation error classes, and set them to be valid

Ryan H
  • 2,620
  • 4
  • 37
  • 109

1 Answers1

0

It's hard to say what you really want without more code. However, you can clear errors from the ErrorBag manually: https://baianat.github.io/vee-validate/api/errorbag.html#errorbag

And you can also use either reset or detach on that field: https://baianat.github.io/vee-validate/api/validator.html#api

Why detach? Well, if you don't care about the result of those validation rules after hitting this method, why keep it attached? You can extend again later if you want. Again, it's hard to say what you are looking for here.

qhrtzll
  • 76
  • 5