Closed
Description
Optional props in Vue 3 are not optional anymore on the resolved props
value from defineProps
:
Additionally, Vue 3 casts optional boolean props to only type boolean
, because of https://vuejs.org/guide/components/props.html#boolean-casting.
The only correct way to allow undefined
for a boolean prop is to manually set it as a default with withDefaults
. (see reproduction components/BooleanWithUndefined.vue
)
This should also reflect in the <template>
.