mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-29 11:20:36 +01:00
chore(Tabs): rename #item slot to #content
This commit is contained in:
@@ -29,7 +29,7 @@ type SlotFunction<T> = (props: { item: T, index: number }) => any
|
|||||||
|
|
||||||
export type TabsSlots<T extends TabsItem> = {
|
export type TabsSlots<T extends TabsItem> = {
|
||||||
default(): any
|
default(): any
|
||||||
item(): SlotFunction<T>
|
content(): SlotFunction<T>
|
||||||
} & {
|
} & {
|
||||||
[key in T['slot'] as string]?: SlotFunction<T>
|
[key in T['slot'] as string]?: SlotFunction<T>
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ const ui = computed(() => tv({ extend: tabs, slots: props.ui })())
|
|||||||
</TabsList>
|
</TabsList>
|
||||||
|
|
||||||
<TabsContent v-for="(item, index) of items" :key="index" force-mount :value="item.value || String(index)" :class="ui.content()">
|
<TabsContent v-for="(item, index) of items" :key="index" force-mount :value="item.value || String(index)" :class="ui.content()">
|
||||||
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
<slot :name="item.slot || 'content'" :item="item" :index="index">
|
||||||
{{ item.content }}
|
{{ item.content }}
|
||||||
</slot>
|
</slot>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user