mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
Co-authored-by: Pooya Parsa <pooya@pi0.io> Co-authored-by: Florent Delerue <florentdelerue@hotmail.com> Co-authored-by: Sébastien Chopin <seb@nuxt.com>
33 lines
751 B
Vue
33 lines
751 B
Vue
<template>
|
|
<div>
|
|
<FieldGroup>
|
|
<ComponentPropsField v-for="prop in meta?.meta?.props" :key="prop.name" :prop="prop" />
|
|
</FieldGroup>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { upperFirst, camelCase } from 'scule'
|
|
|
|
const props = defineProps({
|
|
slug: {
|
|
type: String,
|
|
default: null
|
|
}
|
|
})
|
|
|
|
const route = useRoute()
|
|
|
|
let name = props.slug || `U${upperFirst(camelCase(route.params.slug[route.params.slug.length - 1]))}`
|
|
|
|
// TODO: Remove once merged on `main` branch
|
|
if (['AvatarGroup', 'ButtonGroup', 'MeterGroup'].includes(name)) {
|
|
name = `U${name}`
|
|
}
|
|
if (['avatar-group', 'button-group', 'radio'].includes(name)) {
|
|
name = `U${upperFirst(camelCase(name))}`
|
|
}
|
|
|
|
const meta = await fetchComponentMeta(name)
|
|
</script>
|