prop `boolean` required type error
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
What is expected?
属性 b1、b2、b3
的 required
不一致。
What is actually happening?
属性 b1、b2、b3
的 required
一致。
System Info
No response
Any additional comments?
No response
Required:
<script lang="ts" setup>
const props = defineProps<{
b1: boolean;
b2: boolean;
b3: boolean;
s1: string;
s2: string;
}>();
</script>
Optional:
<script lang="ts" setup>
const props = defineProps<{
b1?: boolean;
b2?: boolean;
b3?: boolean;
s1?: string;
s2?: string;
}>();
</script>
also confuse here
Is the type returned by
DefineProps
generated by thisReadonly<ExtractPropTypes<{ x:Boolean }>>
?check the mini RP
why the x prop is optional not required ?
In my opinion, props in vue3 are defined as optional.