@@ -16,7 +16,7 @@ A Vue 3 composable library for form validation, compatible with Zod, Yup, Joi, V
1616- ** 💨 Bundle Size** : Small bundle size (<3kb).
1717- ** 📦 Zero Dependencies** : No dependencies.
1818- ** ✅ Custom Validation** : Compatible with any other validation libraries using ` transformFn ` .
19- - ** ⚙️ Customizable Validation Modes** : Offers ' eager' and 'lazy' validation modes to fit different user experience needs.
19+ - ** ⚙️ Customizable Validation Modes** : Offers eager, lazy, agressive and onBlur validation modes to fit different user experience needs.
2020- ** 🔗 Reactive Integration** : Fully integrates with Vue’s reactivity system, providing a seamless experience when working with reactive form states.
2121- ** 📈 Performance Optimized** : Efficiently handles validation with minimal performance overhead, making it suitable for large forms.
2222- ** 📅 Easy Integration** : Simple to integrate with existing Vue 3 projects, requiring minimal setup to start validating forms.
@@ -90,7 +90,7 @@ async function onSubmit() {
9090
9191``` ts
9292const options = {
93- mode: ' eager' , // or 'lazy'
93+ mode: ' eager' , // or 'lazy' or 'agressive' or 'onBlur'
9494 transformFn : (schema : InputSchema , form : Form ) => {
9595 // Custom validation logic
9696 return {} // Return errors if any
@@ -115,7 +115,7 @@ declare function useFormValidation<S extends InputSchema<F>, F extends Form>(
115115 schema : S ,
116116 form : MaybeRefOrGetter <F >,
117117 options ? : {
118- mode? : ' eager' | ' lazy' // lazy by default
118+ mode? : ' eager' | ' lazy' | ' agressive ' | ' onBlur ' // lazy by default
119119 transformFn? : GetErrorsFn <S , F >
120120 }
121121): ReturnType <F >
@@ -126,7 +126,7 @@ declare function useFormValidation<S extends InputSchema<F>, F extends Form>(
126126- ** schema ** : The validation schema .
127127- ** form ** : The reactive form object .
128128- ** options ** : Optional configuration object .
129- - ** mode ** : (optional ) Validation mode (` 'eager' ` for immediate validation or ` 'lazy' ` for validation on form changes ).
129+ - ** mode ** : (optional ) Validation mode (` 'eager' ` for immediate validation , ` 'agressive' ` for validation on load , ` 'lazy' ` for validation on form changes or ` 'onBlur' ` for validation on input blur ).
130130 - ** transformFn ** : (optional ) A transformation function that can be used when integrating a different validation library. It allows you to transform data before it is validated. Use this option only if you are integrating another validation library that requires specific data handling.
131131
132132#### Return Value
0 commit comments