mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
42 lines
941 B
Vue
42 lines
941 B
Vue
<script setup lang="ts">
|
|
import { upperFirst, camelCase } from 'scule'
|
|
|
|
const props = defineProps<{
|
|
prose?: boolean
|
|
}>()
|
|
|
|
const route = useRoute()
|
|
|
|
const camelName = camelCase(route.path.split('/').pop() ?? '')
|
|
const name = props.prose ? `Prose${upperFirst(camelName)}` : `U${upperFirst(camelName)}`
|
|
|
|
const meta = await fetchComponentMeta(name as any)
|
|
</script>
|
|
|
|
<template>
|
|
<ProseTable>
|
|
<ProseThead>
|
|
<ProseTr>
|
|
<ProseTh>
|
|
Event
|
|
</ProseTh>
|
|
<ProseTh>
|
|
Type
|
|
</ProseTh>
|
|
</ProseTr>
|
|
</ProseThead>
|
|
<ProseTbody>
|
|
<ProseTr v-for="event in (meta?.meta?.events || [])" :key="event.name">
|
|
<ProseTd>
|
|
<ProseCode>
|
|
{{ event.name }}
|
|
</ProseCode>
|
|
</ProseTd>
|
|
<ProseTd>
|
|
<HighlightInlineType v-if="event.type" :type="event.type" />
|
|
</ProseTd>
|
|
</ProseTr>
|
|
</ProseTbody>
|
|
</ProseTable>
|
|
</template>
|