diff --git a/src/runtime/components/InputMenu.vue b/src/runtime/components/InputMenu.vue index 8658b1db..c70ad899 100644 --- a/src/runtime/components/InputMenu.vue +++ b/src/runtime/components/InputMenu.vue @@ -36,7 +36,6 @@ interface _InputMenuItem { * @defaultValue 'item' */ type?: 'label' | 'separator' | 'item' - value?: string | number disabled?: boolean onSelect?(e?: Event): void [key: string]: any diff --git a/src/runtime/components/SelectMenu.vue b/src/runtime/components/SelectMenu.vue index fefcbb60..65a68e11 100644 --- a/src/runtime/components/SelectMenu.vue +++ b/src/runtime/components/SelectMenu.vue @@ -36,7 +36,6 @@ interface _SelectMenuItem { * @defaultValue 'item' */ type?: 'label' | 'separator' | 'item' - value?: string | number disabled?: boolean onSelect?(e?: Event): void [key: string]: any diff --git a/test/components/InputMenu.spec.ts b/test/components/InputMenu.spec.ts index 62cdeb2f..71ae8b57 100644 --- a/test/components/InputMenu.spec.ts +++ b/test/components/InputMenu.spec.ts @@ -186,6 +186,12 @@ describe('InputMenu', () => { valueKey: 'value' })).toEqualTypeOf<[number[]]>() + // with object item and object valueKey + expectEmitPayloadType('update:modelValue', () => InputMenu({ + items: [{ label: 'foo', value: { id: 1, name: 'bar' } }], + valueKey: 'value' + })).toEqualTypeOf<[{ id: number, name: string }]>() + // with string item expectEmitPayloadType('update:modelValue', () => InputMenu({ items: ['foo'] diff --git a/test/components/SelectMenu.spec.ts b/test/components/SelectMenu.spec.ts index f2455a5a..8c3be877 100644 --- a/test/components/SelectMenu.spec.ts +++ b/test/components/SelectMenu.spec.ts @@ -191,6 +191,12 @@ describe('SelectMenu', () => { valueKey: 'value' })).toEqualTypeOf<[number[]]>() + // with object item and object valueKey + expectEmitPayloadType('update:modelValue', () => SelectMenu({ + items: [{ label: 'foo', value: { id: 1, name: 'bar' } }], + valueKey: 'value' + })).toEqualTypeOf<[{ id: number, name: string }]>() + // with string item expectEmitPayloadType('update:modelValue', () => SelectMenu({ items: ['foo']