Does Vuelidate support typescript in VueJs?
Asked Answered
J

3

10

Does Vuelidate support typescript in VueJs? If yes, how to use?

I am able to use it with JavaScript.

Joselyn answered 13/1, 2020 at 18:22 Comment(0)
T
11

Looks like the types for this library are shipped separately.

Just install @types/vuelidate with npm or yarn

Tennietenniel answered 13/1, 2020 at 18:25 Comment(4)
Also make sure to install it as a dev dependency, as you don't need to build it into your website. You can do so by entering npm i @types/vuelidate -DHogfish
I tried installing using types, but no luck. Am I doing something wrong?,Joselyn
I had to cast vuelidate to any like below. Then it worked. Vue.use(Vuelidate as any)Joselyn
what's the type for the v variable (e.g. when passing it components)? Thanks!Myel
B
2

Update 2023

Types are included in @vuelidate/core

Bullwhip answered 26/6, 2023 at 9:27 Comment(0)
C
0

You may want to check this github thread. Specifically this one works for me.

Calhoun answered 19/6, 2022 at 2:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.