Skip to content

Type error on (form) values and handleSubmit not correct when using a computed as initial values #4402

@Ricky-rick

Description

@Ricky-rick

What happened?

The types for the values returned from useForm and the fomdata in the handleSubmit closure are not correct when u use a computed as initialValue

Reproduction steps

  1. goto https://stackblitz.com/edit/vee-validate-computed-initial-values-bug?file=src%2FApp.vue
  2. click the submit button, (see tha the data.email is working and data.value.email is not)
  3. open a extra teminal at the bottom
  4. type vue-tsc --noEmit {enter}
  5. see the follwing error (on data.email and not on data.value.email)
 error TS2339: Property 'email' does not exist on type 'ComputedRef<{ email: string; }>'.
16       data.email +

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

error TS2339: Property 'email' does not exist on type 'ComputedRef<{ email: string; }>'.
16       data.email +


### Demo link

https://stackblitz.com/edit/vee-validate-computed-initial-values-bug?file=src%2FApp.vue

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](CONDUCT.md)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions