M
M
myskypesla2018-04-22 22:49:36
Vue.js
myskypesla, 2018-04-22 22:49:36

How to catch that there are no errors in VeeValidate on the fly and activate the button?

Tell me how to catch an event on the fly in VeeValidate that all fields are filled and all checkboxes are checked?
I need to remove the class from the button, at the moment when everything is correct.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Kitaev, 2018-04-23
@deliro

Computed

M
Maxim, 2018-04-24
@m_pchelnikov

Did it like this:

computed: {
      isFormValid() {
        return Object.keys(this.fields)
          .every(key => this.fields[key] && this.fields[key].dirty && this.fields[key].valid);
      },
    }

Here we check that each field has been changed and is being validated

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question