TS Error with actions as parameter in Submit #3112
-
Working on learning vee-validate. I'm trying to add the actions parameter as shown here: Using Vue3, Composition API. I do get the actions and values, but I also get this error from typescript Type '(values: any, actions: any) => void' is not assignable to type '(payload: Event) => void'.ts(2322) Any guidance on how to solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
Could you create a code sample? either a codesandbox or a repo would be fine. |
Beta Was this translation helpful? Give feedback.
-
Here you go. https://github.com/JohnCampionJr/vee-validate-vue3-ts It seems to just be a type issue as it actually works just fine (which is why I wasn't sure if I should make an issue or a discussion) VS Code throws a TS error on the @submit handler if I put two parameters in. I tried renaming Form to VeeForm to see if it was parsing the form element wrong or something, but it didn't change it. |
Beta Was this translation helpful? Give feedback.
-
I think I figured it out. It seems more likely to be a glitch with Volar. https://github.com/johnsoncodehk/volar/ If I switch Volar off, the error disappears (and ESLint still works which is why I think its the Volar extension) |
Beta Was this translation helpful? Give feedback.
-
See the reply on the Volar repo: |
Beta Was this translation helpful? Give feedback.
See the reply on the Volar repo:
vuejs/language-tools#41