Create VeeValidate rules that use asynchronous function calls for input validation (requires p-queue, Vue.js 2.x and VeeValidate 3.x)
VeeValidate is a great Validation Framework for Vue.js, but lacks examples and support for asynchronous function validation, even though it's a supported feature.
This example shows how a new "asyncCall" rule can use the result of an asynchronous function call to decide whether an input was successfully validated or not.
The asynchronous function (used as the "asyncFn" property of the "asyncCall" rule) must accept (as the only parameter) a value to be validated and must return an object that provides information on the validation status (see function "createAsyncQueueData").
The informations about the last validated value are cached in the "asyncQueue" property of the "asyncCall" rule.
Requires:
npm install vue@2 --save
npm install vee-validate@3 --save
npm install p-queue --save
Used as frontend toolkit:
npm install bootstrap@4 --save