docs(app): handle prose components (#3030)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Hugo Richard
2025-01-08 16:17:50 +01:00
committed by GitHub
parent 6a81db2b9c
commit 638808c32c
6 changed files with 66 additions and 10 deletions

View File

@@ -1,10 +1,14 @@
<script setup lang="ts">
import { upperFirst, camelCase } from 'scule'
const props = defineProps<{
prose?: boolean
}>()
const route = useRoute()
const camelName = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '')
const name = `U${upperFirst(camelName)}`
const name = props.prose ? `Prose${upperFirst(camelName)}` : `U${upperFirst(camelName)}`
const meta = await fetchComponentMeta(name as any)
</script>