InputSwitch TypeScript modelValue error #2262
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Current behavior
VSCode reports an error for modelValue if its not boolean. In my following example the error is:
Expected behavior
No error.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Ideally, I want everything to be typed; which is also why I started using type checks for my template as well.
To me, the
InputSwitchProps
should havetrueValue
set totrue
andfalseValue
set tofalse
by default. The parametermodelValue
could now allow both types oftrueValue
andfalseValue
. I just don't quite know how to write a type like that 😅Here's a quick start of how it could be - just needs to be refined:
Please tell us about your environment:
Visual Studio Code
Vue version: 3.2.29
PrimeVue version: 3.11.0
The text was updated successfully, but these errors were encountered: