Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing ComponentFieldBindingObject type for custom fields #4657

Closed
frank-compx opened this issue Feb 10, 2024 · 1 comment
Closed

Exposing ComponentFieldBindingObject type for custom fields #4657

frank-compx opened this issue Feb 10, 2024 · 1 comment
Labels
👕 TypeScript TypeScript typings issue

Comments

@frank-compx
Copy link

frank-compx commented Feb 10, 2024

Is your feature request related to a problem? Please describe.

I'm most likely doing this wrong as I haven't found any documentation about it, so please show me the correct way if I am. I want to define a custom field by using the exposed componentField slot property that is in turn also exposed from the <Field> component, so:

<Form>
  <Field v-slot="{ componentField }">
    <CustomField v-bind="componentField" />
  </Field>
</Form>

Now I can see in the vee-validate.d.ts file that there is an interface called ComponentFieldBindingObject that defines the properties that would be needed in my custom component <CustomField>, but the interface is not exported and therefore have to re-define my own.

Describe the solution you'd like

Be able to use the vee-validate native ComponentFieldBindingObject interface

Describe alternatives you've considered

Define my own copy, which is no big deal but would be nice to use the native interface.

@logaretm logaretm added the 👕 TypeScript TypeScript typings issue label Feb 13, 2024
@logaretm
Copy link
Owner

That is a reasonable ask, it should've been exposed since it is a public API. Should be up with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👕 TypeScript TypeScript typings issue
Projects
None yet
Development

No branches or pull requests

2 participants