From 865a47f125f1a369a59326b65461f1a25004a841 Mon Sep 17 00:00:00 2001 From: Hugo Richard Date: Tue, 14 Jan 2025 10:31:41 +0100 Subject: [PATCH] docs(ComponentSlots): support custom slug (#3096) --- docs/app/components/content/ComponentSlots.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/app/components/content/ComponentSlots.vue b/docs/app/components/content/ComponentSlots.vue index 6886de7d..e27d08d0 100644 --- a/docs/app/components/content/ComponentSlots.vue +++ b/docs/app/components/content/ComponentSlots.vue @@ -3,12 +3,13 @@ import { upperFirst, camelCase } from 'scule' const props = defineProps<{ prose?: boolean + slug?: string }>() const route = useRoute() -const camelName = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '') -const name = props.prose ? `Prose${upperFirst(camelName)}` : `U${upperFirst(camelName)}` +const camelName = camelCase(props.slug ?? route.params.slug?.[route.params.slug.length - 1] ?? '') +const name = `${props.prose ? 'Prose' : 'U'}${upperFirst(camelName)}` const meta = await fetchComponentMeta(name as any)