diff --git a/packages/docs/src/data/new-in.json b/packages/docs/src/data/new-in.json index 181584b3b39..2c833b69b46 100644 --- a/packages/docs/src/data/new-in.json +++ b/packages/docs/src/data/new-in.json @@ -238,6 +238,10 @@ "VTabs": { "props": { "spaced": "3.10.0" + }, + "slots": { + "next": "3.10.0", + "prev": "3.10.0" } }, "VTextField": { diff --git a/packages/vuetify/src/components/VTabs/VTabs.tsx b/packages/vuetify/src/components/VTabs/VTabs.tsx index 7e5a9cfad93..a1185a2681c 100644 --- a/packages/vuetify/src/components/VTabs/VTabs.tsx +++ b/packages/vuetify/src/components/VTabs/VTabs.tsx @@ -21,6 +21,7 @@ import { VTabsSymbol } from './shared' import { convertToUnit, genericComponent, isObject, pick, propsFactory, useRender } from '@/util' // Types +import type { VSlideGroupSlots } from 'lib/components/VSlideGroup/VSlideGroup' import type { PropType } from 'vue' import type { GenericProps } from '@/util' @@ -30,7 +31,7 @@ export type VTabsSlot = { item: T } -export type VTabsSlots = { +export type VTabsSlots = Pick & { default: never tab: VTabsSlot item: VTabsSlot @@ -144,19 +145,23 @@ export const VTabs = genericComponent( { ...scopeId } { ...attrs } > - { slots.default?.() ?? items.value.map(item => ( - slots.tab?.({ item }) ?? ( - slots[`tab.${item.value}`]?.({ item }) : undefined, - }} - /> - ) - ))} + {{ + default: slots.default ?? (() => items.value.map(item => ( + slots.tab?.({ item }) ?? ( + slots[`tab.${item.value}`]?.({ item }) : undefined, + }} + /> + ) + ))), + prev: slots.prev, + next: slots.next, + }} { hasWindow && (