Skip to content

Commit f20636a

Browse files
committed
refactor(VList): make itemType optional in useListItems
fixes #19476
1 parent 3ee87ac commit f20636a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/vuetify/src/components/VList/VList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function isPrimitive (value: unknown): value is string | number | boolean {
3838
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean'
3939
}
4040

41-
function transformItem (props: ItemProps & { itemType: string }, item: any): InternalListItem {
41+
function transformItem (props: ItemProps & { itemType?: string }, item: any): InternalListItem {
4242
const type = getPropertyFromItem(item, props.itemType, 'item')
4343
const title = isPrimitive(item) ? item : getPropertyFromItem(item, props.itemTitle)
4444
const value = getPropertyFromItem(item, props.itemValue, undefined)
@@ -63,7 +63,7 @@ function transformItem (props: ItemProps & { itemType: string }, item: any): Int
6363
}
6464
}
6565

66-
function transformItems (props: ItemProps & { itemType: string }, items: (string | object)[]) {
66+
function transformItems (props: ItemProps & { itemType?: string }, items: (string | object)[]) {
6767
const array: InternalListItem[] = []
6868

6969
for (const item of items) {
@@ -73,7 +73,7 @@ function transformItems (props: ItemProps & { itemType: string }, items: (string
7373
return array
7474
}
7575

76-
export function useListItems (props: ItemProps & { itemType: string }) {
76+
export function useListItems (props: ItemProps & { itemType?: string }) {
7777
const items = computed(() => transformItems(props, props.items))
7878

7979
return { items }

packages/vuetify/src/labs/VTreeview/VTreeview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const makeVTreeviewProps = propsFactory({
3535
collapseIcon: '$treeviewCollapse',
3636
expandIcon: '$treeviewExpand',
3737
slim: true,
38-
}), ['nav']),
38+
}), ['itemType', 'nav']),
3939
}, 'VTreeview')
4040

4141
export const VTreeview = genericComponent<new <T>(

0 commit comments

Comments
 (0)