logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.79k stars 1.26k forks source link

Exposing `ComponentFieldBindingObject` type for custom fields #4657

Closed frank-compx closed 8 months ago

frank-compx commented 8 months ago

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 commented 8 months ago

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