mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
docs(ComponentCode/ComponentExample): add class prop
This commit is contained in:
@@ -6,6 +6,7 @@ import * as theme from '#build/ui'
|
||||
import { get, set } from '#ui/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: any
|
||||
/** List of props to ignore in selection */
|
||||
ignore?: string[]
|
||||
/** List of props to hide from code and selection */
|
||||
@@ -231,7 +232,7 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${JSON.stringif
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="flex border border-b-0 border-gray-300 dark:border-gray-700 relative p-4" :class="[!options.length && 'rounded-t-md']">
|
||||
<div class="flex border border-b-0 border-gray-300 dark:border-gray-700 relative p-4" :class="[!options.length && 'rounded-t-md', props.class]">
|
||||
<component :is="name" v-bind="componentProps">
|
||||
<template v-for="slot in Object.keys(slots || {})" :key="slot" #[slot]>
|
||||
<ContentSlot :name="slot" unwrap="p">
|
||||
|
||||
@@ -3,6 +3,7 @@ import { camelCase } from 'scule'
|
||||
|
||||
const props = defineProps<{
|
||||
name: string
|
||||
class?: any
|
||||
props?: { [key: string]: any }
|
||||
/**
|
||||
* Whether to format the code with Prettier
|
||||
@@ -44,7 +45,7 @@ const { data: ast } = await useAsyncData(`component-example-${camelName}`, async
|
||||
<template>
|
||||
<div class="my-5">
|
||||
<div>
|
||||
<div class="flex border border-b-0 border-gray-300 dark:border-gray-700 relative p-4 rounded-t-md">
|
||||
<div class="flex border border-b-0 border-gray-300 dark:border-gray-700 relative p-4 rounded-t-md" :class="[props.class]">
|
||||
<component :is="camelName" v-bind="componentProps" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user