How to use the vee-validate.validate function in vee-validate

To help you get started, we’ve selected a few vee-validate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github logaretm / vue-use-form / src / useField.ts View on Github external
onMounted(() => {
    validate(initialValue, isRef(rules) ? rules.value : rules).then(result => {
      if (immediate) {
        commitResult(result);
        return;
      }

      // Initial silent validation.
      flags.valid.value = result.valid;
      flags.invalid.value = !result.valid;
    });
  });
github logaretm / vue-use-form / src / useField.ts View on Github external
const validateField = async (newVal: any): Promise => {
    flags.pending.value = true;
    const result = await validate(newVal, isRef(rules) ? rules.value : rules, {
      name: fieldName,
      values: form?.valueRecords ?? {}
    });

    commitResult(result);

    return result;
  };