Skip to content

Commit

Permalink
docs(ComponentProps): add support for name as prop
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Dec 9, 2024
1 parent 1acf993 commit 9fc42ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/app/components/content/ComponentProps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as theme from '#build/ui'
import * as themePro from '#build/ui-pro'
const props = withDefaults(defineProps<{
name?: string
ignore?: string[]
pro?: boolean
}>(), {
Expand All @@ -31,11 +32,11 @@ const props = withDefaults(defineProps<{
const route = useRoute()
const camelName = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '')
const name = `U${upperFirst(camelName)}`
const camelName = camelCase(props.name ?? route.params.slug?.[route.params.slug.length - 1] ?? '')
const componentName = `U${upperFirst(camelName)}`
const componentTheme = ((props.pro ? themePro : theme) as any)[camelName]
const meta = await fetchComponentMeta(name as any)
const meta = await fetchComponentMeta(componentName as any)
const metaProps: ComputedRef<ComponentMeta['props']> = computed(() => {
if (!meta?.meta?.props?.length) {
Expand Down

0 comments on commit 9fc42ba

Please sign in to comment.