Skip to content

Commit 7e6675d

Browse files
committed
feat: added context information to validation functions
1 parent a048c90 commit 7e6675d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/vee-validate/src/validate.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ async function _validate(field: FieldValidationContext, value: any) {
5757

5858
// if a generic function, use it as the pipeline.
5959
if (isCallable(field.rules)) {
60-
const result = await field.rules(value);
60+
const result = await field.rules(value, {
61+
field: field.name,
62+
form: field.formData,
63+
});
6164
const isValid = typeof result !== 'string' && result;
6265
const message =
6366
typeof result === 'string'

0 commit comments

Comments
 (0)