davestewart / vee-element

Replaces Element UI's validation engine with Vee Validate
http://vee-element.netlify.com
MIT License
73 stars 8 forks source link

Backend validation does not work #22

Closed Artem-Schander closed 5 years ago

Artem-Schander commented 5 years ago

Hi,

many thanks for the implementation. It's very usefull. Maybe you've already noticed in the other issue. I need to velidate some fields server side. It seem not to be possible with this lib. I'm getting valid true where i should get false by async validation.

Artem-Schander commented 5 years ago

I apologize. I tried to create a minimalistic example and could not recreate my issue. So I think the behaviour is caused by something else in my (really complex) form.

However .. Nice Plugin. Thanks again

Artem-Schander commented 5 years ago

For the case someone stumbles upon this while experiencing similar issues. Here is what caused it in my case.

The callback function returns true if there is a prop defined which has no rules. In this example you can see, that there is no rule for name. The validator does not wait for the Promise to get resolved and calls the cb function immediately.

In which case are these lines necessary?