defineProps with a TS type and optional boolean has inconsistent behavior #5030
Unanswered
TheDutchCoder
asked this question in
Q&A
Replies: 2 comments 2 replies
-
This is generally expected, as we should not make this prop required when using the component, in which case please use |
Beta Was this translation helpful? Give feedback.
2 replies
-
Awesome, thanks!
…On Sun, Dec 8, 2024, 10:11 a.m. 山吹色御守 ***@***.***> wrote:
Please track vuejs/core#12509 <vuejs/core#12509>.
—
Reply to this email directly, view it on GitHub
<#5030 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMXI3ZYGJRHAI4R7X6IIVL2ERORZAVCNFSM6AAAAABTE647JKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBZHE4DSNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We use TS to define props this way:
This all works, but Vue compiles optional booleans as
false
, not asundefined
.What's interesting is that in the template this works if you access
props.foo
, but notfoo
:Our question is: is this a Vue bug, or a language tools bug?
Beta Was this translation helpful? Give feedback.
All reactions