useFetchComponentMeta
Overview
Fetches the metadata of a Vue component, including its Props, Emits, and Slots. Returns a useAsyncData ref object with client-side cache reuse.
<script setup lang="ts">
const { data: meta } = useFetchComponentMeta('MyButton')
console.log(meta.value?.meta?.props) // Props definitions
console.log(meta.value?.meta?.events) // Events definitions
console.log(meta.value?.meta?.slots) // Slots definitions
</script>
Displaying Props documentation
<template>
<ul>
<li v-for="prop in (meta?.meta?.props || [])" :key="prop.name">
<code>{{ prop.name }}</code>: {{ prop.type }}
</li>
</ul>
</template>
<script setup lang="ts">
const { data: meta } = useFetchComponentMeta('MyButton')
</script>
API
useFetchComponentMeta(name)
Fetches component metadata.
Parameters
Return value
Returns the useAsyncData result object.
props, events, slots, and more.Related
- ComponentProps — generate a Props documentation table in a single line of Markdown
- ComponentSlots — automatically generate Slots documentation
- ComponentEmits — automatically generate Emits documentation
Changelog
useTheme
useTheme is the core composable of the theme customization system, managing the primary color, neutral color, border radius, font family, and icon set configuration, with support for dark, light, and system color modes. From the ThemePicker, you can export CSS variables or app.config.ts configuration to persist your theme.
useFetchComponentExample
useFetchComponentExample fetches the example code of Vue components registered via the component-example module, returning reactive data that includes the source code string, the PascalCase component name, and the file path, with SSR support and automatic payload reuse during client-side navigation, and zero duplicate requests.