Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zaalbarxx committed Nov 23, 2023
1 parent d6c5ed9 commit e650e31
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/vee-validate/src/Field.ts
@@ -1,4 +1,14 @@
import { h, defineComponent, toRef, SetupContext, resolveDynamicComponent, computed, PropType, VNode } from 'vue';
import {
h,
defineComponent,
toRef,
SetupContext,
resolveDynamicComponent,
computed,
PropType,
VNode,
UnwrapRef,
} from 'vue';
import { getConfig } from './config';
import { RuleExpression, useField } from './useField';
import { normalizeChildren, hasCheckedAttr, shouldHaveValueBinding, isPropPresent } from './utils';
Expand Down Expand Up @@ -236,6 +246,10 @@ const FieldImpl = /** #__PURE__ */ defineComponent({
}

ctx.expose({
value,
meta,
errors,
errorMessage,
setErrors,
setTouched,
reset: resetField,
Expand Down Expand Up @@ -296,6 +310,10 @@ function resolveInitialValue(props: Record<string, unknown>, ctx: SetupContext<a

export const Field = FieldImpl as typeof FieldImpl & {
new (): {
value: UnwrapRef<FieldContext['value']>;
meta: UnwrapRef<FieldContext['meta']>;
errors: UnwrapRef<FieldContext['errors']>;
errorMessage: UnwrapRef<FieldContext['errorMessage']>;
setErrors: FieldContext['setErrors'];
setTouched: FieldContext['setTouched'];
reset: FieldContext['resetField'];
Expand Down

0 comments on commit e650e31

Please sign in to comment.