@@ -38,7 +38,7 @@ function isPrimitive (value: unknown): value is string | number | boolean {
38
38
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean'
39
39
}
40
40
41
- function transformItem ( props : ItemProps & { itemType : string } , item : any ) : InternalListItem {
41
+ function transformItem ( props : ItemProps & { itemType ? : string } , item : any ) : InternalListItem {
42
42
const type = getPropertyFromItem ( item , props . itemType , 'item' )
43
43
const title = isPrimitive ( item ) ? item : getPropertyFromItem ( item , props . itemTitle )
44
44
const value = getPropertyFromItem ( item , props . itemValue , undefined )
@@ -63,7 +63,7 @@ function transformItem (props: ItemProps & { itemType: string }, item: any): Int
63
63
}
64
64
}
65
65
66
- function transformItems ( props : ItemProps & { itemType : string } , items : ( string | object ) [ ] ) {
66
+ function transformItems ( props : ItemProps & { itemType ? : string } , items : ( string | object ) [ ] ) {
67
67
const array : InternalListItem [ ] = [ ]
68
68
69
69
for ( const item of items ) {
@@ -73,7 +73,7 @@ function transformItems (props: ItemProps & { itemType: string }, items: (string
73
73
return array
74
74
}
75
75
76
- export function useListItems ( props : ItemProps & { itemType : string } ) {
76
+ export function useListItems ( props : ItemProps & { itemType ? : string } ) {
77
77
const items = computed ( ( ) => transformItems ( props , props . items ) )
78
78
79
79
return { items }
0 commit comments