Skip to content

Commit

Permalink
fix(VTab): pass through VBtn slots
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Nov 21, 2023
1 parent 48c6573 commit aeaa776
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions packages/vuetify/src/components/VTabs/VTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { animate, genericComponent, omit, propsFactory, standardEasing, useRende

// Types
import type { PropType } from 'vue'
import type { VBtnSlots } from '@/components/VBtn/VBtn'

export const makeVTabProps = propsFactory({
fixed: Boolean,
Expand All @@ -39,7 +40,7 @@ export const makeVTabProps = propsFactory({
]),
}, 'VTab')

export const VTab = genericComponent()({
export const VTab = genericComponent<VBtnSlots>()({
name: 'VTab',

props: makeVTabProps(),
Expand Down Expand Up @@ -122,18 +123,25 @@ export const VTab = genericComponent()({
maxWidth={ props.fixed ? 300 : undefined }
onGroup:selected={ updateSlider }
>
{ slots.default?.() ?? props.text }

{ !props.hideSlider && (
<div
ref={ sliderEl }
class={[
'v-tab__slider',
sliderColorClasses.value,
]}
style={ sliderColorStyles.value }
/>
)}
{{
...slots,
default: () => (
<>
{ slots.default?.() ?? props.text }

{ !props.hideSlider && (
<div
ref={ sliderEl }
class={[
'v-tab__slider',
sliderColorClasses.value,
]}
style={ sliderColorStyles.value }
/>
)}
</>
),
}}
</VBtn>
)
})
Expand Down

0 comments on commit aeaa776

Please sign in to comment.