This is a data validator inspired by https://github.com/yiminghe/async-validator and adapted to VueJS fixing the lack of other data validators and with the following features:
No matter what template library you use, this validator will simply work.
Focused in developer easiness to save time and headaches.
When an object is loaded from server you can set it without worring, it will restore attribute watchers.
If you have nested data objects to validate, this mixin will deal with it without trouble.
If a validation in value fails will not run the rest of validations for the value, reducing time and processing considerably.
Will detect if the returned validation is a promise and handle properly without need of external packages.
I have found that in some validators the results are showed in the next tick. This mixin forces the render to be updated once the validations are finished so no delays on result are produced.
If a typing is being validated against a resource it will control the times in order to ensure that the last one is the validation that prevails against the previuos.
It controls whether a validation is performed or not, so if the value does not change it will not be validated again, saving time and processing.
This validator is served as a mixin just with vue as dependency in order to reduce the processing, time and load. It is set out to accomplish most of the use cases so it is adapted to common use needs.
Feel free to contribute or bring suggestions, any improvement will be at least taken in mind, discussed and accepted if reasonable, just keep the the previous rules in mind.
Please visit our wiki that we bother to keep updated to know everything about this component: https://github.com/deulos/vuejs-model-validator/wiki