Skip to content

Commit

Permalink
fix(VTabs): change parsed items array key title to text
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Sep 19, 2023
1 parent fce67bf commit ac90099
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vuetify/src/components/VTabs/VTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import { makeTagProps } from '@/composables/tag'

// Utilities
import { computed, toRef } from 'vue'
import { convertToUnit, genericComponent, propsFactory, useRender } from '@/util'
import { convertToUnit, genericComponent, isObject, propsFactory, useRender } from '@/util'

// Types
import type { PropType } from 'vue'
import { VTabsSymbol } from './shared'

export type TabItem = string | Record<string, any>
export type TabItem = string | number | Record<string, any>

function parseItems (items: readonly TabItem[] | undefined) {
if (!items) return []

return items.map(item => {
if (typeof item === 'string') return { title: item, value: item }
if (!isObject(item)) return { text: item, value: item }

return item
})
Expand Down Expand Up @@ -113,7 +113,7 @@ export const VTabs = genericComponent()({
symbol={ VTabsSymbol }
>
{ slots.default ? slots.default() : parsedItems.value.map(item => (
<VTab { ...item } key={ item.title } />
<VTab { ...item } key={ item.text } />
))}
</VSlideGroup>
)
Expand Down

0 comments on commit ac90099

Please sign in to comment.