-
Notifications
You must be signed in to change notification settings - Fork 533
Async validators #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you post the usage of your validator ? This part seems a bit wrong to me since your are returning a Promise here basically instead of an array return axios.post('api/scaffolder/validate-short', {"short": value}).then(response => {
if (response.data.valid == false) {
return ['The short already exists'];
}
return null;
}); |
vfg can't support async validators. |
@icebob really? |
@icebob but would you like to support them? if not I couldn't use this repo anymore |
what about drop de built in validation, change the fields generation and integrate with Vee Validate? |
Dont think that's an option. For example I got rid of Vee validate and all it's stuff and switched to form generator and form generator validations because Vee validate requires a lot of boilerplate code. If you want a field validation you have to add like 3 html wrappers and functions and it gets really messy with custom components like date pickers or external stuff you cannot control so easily. |
yep, that's why I bet for VFG when I saw it, however, ajax validation is a must for me as is the most common use case in my world. Not having this feature implemented here makes the library less powerful (no offence). I could spend a bunch of hours working on this feature if @icebob wants to support async validation and he has an idea about which path to take for this one. |
Does vee validate support async validation? |
@cristijora yes, it works quite well. |
Can you post a fiddle so I understand how it works? |
@jmverges I think it is a good feature. |
I'm trying a quick implementation with Promise |
Please share the result/attempt in a PR maybe. |
@jmverges I implemented. If you can, please try it. |
Hi folks,
I'm trying to do this:
However if the value is > 2 field is always in green, even if response.data.valid is false. Is VFG able to have ajax validations?
Best,
Juan Manuel.
The text was updated successfully, but these errors were encountered: