docs(ComponentProps): improve display

This commit is contained in:
Benjamin Canac
2024-07-24 15:53:31 +02:00
parent 5176bf92bc
commit 5114136d25
2 changed files with 4 additions and 3 deletions

View File

@@ -24,6 +24,8 @@ const metaProps: ComputedRef<ComponentMeta['props']> = computed(() => {
return !props.ignore?.includes(prop.name)
}).map((prop) => {
prop.default = prop.default ?? prop.tags?.find(tag => tag.name === 'defaultValue')?.text ?? componentTheme?.defaultVariants?.[prop.name]
// @ts-expect-error - Type is not correct
prop.type = !['boolean'].includes(prop.type) && prop.schema?.kind === 'enum' && Object.keys(prop.schema.schema)?.length ? Object.values(prop.schema.schema).map(schema => schema?.type ? schema.type : schema).join(' | ') : prop.type
return prop
}).sort((a, b) => {
if (a.name === 'as') {