docs(ComponentProps): add ? when prop is optional

This commit is contained in:
Benjamin Canac
2024-07-17 11:55:19 +02:00
parent 4e99ebf605
commit 09c6fce8eb

View File

@@ -24,7 +24,7 @@ const schemaProps = computed(() => getSchemaProps(props.prop.schema))
<Collapsible v-if="schemaProps?.length" class="mt-1">
<ProseUl>
<ProseLi v-for="schemaProp in schemaProps" :key="schemaProp.name">
<HighlightInlineType :type="`${schemaProp.name}: ${schemaProp.type}`" />
<HighlightInlineType :type="`${schemaProp.name}${schemaProp.required === false ? '?' : ''}: ${schemaProp.type}`" />
</ProseLi>
</ProseUl>
</Collapsible>