mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 08:50:34 +01:00
docs(ComponentSlots): support custom slug (#3096)
This commit is contained in:
@@ -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)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user