Optional props are incorrectly typed in <template>
#3779
Labels
bug
Something isn't working
good reproduction ✨
This issue provides a good reproduction, we will be able to investigate it first
upstream
Optional props in Vue 3 are not optional anymore on the resolved
props
value fromdefineProps
: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 withwithDefaults
. (see reproductioncomponents/BooleanWithUndefined.vue
)This should also reflect in the
<template>
.Link to reproduction
The text was updated successfully, but these errors were encountered: