You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by TheDutchCoder December 7, 2024
We use TS to define props this way:
constprops=defineProps<{foo?: boolean}>()
This all works, but Vue compiles optional booleans as false, not as undefined.
What's interesting is that in the template this works if you access props.foo, but not foo:
<template><!-- Throws error as foo can be undefined --><SomeComponent:is-visible="foo" /></template><template><!-- This works as expected --><SomeComponent:is-visible="props.foo" /></template>
Our question is: is this a Vue bug, or a language tools bug?
The text was updated successfully, but these errors were encountered:
Discussed in #5030
Originally posted by TheDutchCoder December 7, 2024
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?
The text was updated successfully, but these errors were encountered: