chore: update component preview

This commit is contained in:
zernonia 2023-10-24 20:09:07 +08:00
parent 6dd6edfbc0
commit 925aeb43d7
4 changed files with 14 additions and 10 deletions

View File

@ -7,7 +7,11 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/lib/registry/default
import { useConfigStore } from '@/stores/config'
import { cn } from '@/lib/utils'
const props = withDefaults(defineProps<{
defineOptions({
inheritAttrs: false,
})
withDefaults(defineProps<{
name: string
align?: 'center' | 'start' | 'end'
sfcTsCode?: string
@ -54,7 +58,7 @@ const { style } = useConfigStore()
'items-end': align === 'end',
})"
>
<ComponentLoader :key="style" :name="name" />
<ComponentLoader v-bind="$attrs" :key="style" :name="name" />
</div>
</TabsContent>
<TabsContent value="code">

View File

@ -6,7 +6,7 @@ primitive: https://www.radix-vue.com/components/accordion.html
---
<ComponentPreview name="AccordionDemo" class="[&_.accordion]:sm:max-w-[70%]" />
<ComponentPreview name="AccordionDemo" class="sm:max-w-[70%]" />
## Installation

View File

@ -4,7 +4,7 @@ description: Displays a form input field or a component that looks like an input
---
<ComponentPreview name="InputDemo" class="[&_input]:max-w-xs" />
<ComponentPreview name="InputDemo" class="max-w-xs" />
## Installation
@ -45,23 +45,23 @@ import { Input } from '@/components/ui/input'
### Default
<ComponentPreview name="InputDemo" class="[&_input]:max-w-xs" />
<ComponentPreview name="InputDemo" class="max-w-xs" />
### File
<ComponentPreview name="InputFile" class="[&_input]:max-w-xs" />
<ComponentPreview name="InputFile" class="max-w-xs" />
### Disabled
<ComponentPreview name="InputDisabled" class="[&_input]:max-w-xs" />
<ComponentPreview name="InputDisabled" class="max-w-xs" />
### With Label
<ComponentPreview name="InputWithLabel" class="[&_input]:max-w-xs" />
<ComponentPreview name="InputWithLabel" class="max-w-xs" />
### With Button
<ComponentPreview name="InputWithButton" class="[&_input]:max-w-xs" />
<ComponentPreview name="InputWithButton" class="max-w-xs" />
### Form

View File

@ -59,7 +59,7 @@ import { Textarea } from '@/components/ui/textarea'
### With Label
<ComponentPreview name="TextareaWithLabel" className="[&_div.grid]:w-full" />
<ComponentPreview name="TextareaWithLabel" />
### With Text