mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-20 23:11:43 +01:00
feat(Accordion/Breadcrumb/CommandPalette/ContextMenu/DropdownMenu/NavigationMenu/Tabs): add labelKey prop
This commit is contained in:
@@ -50,6 +50,11 @@ export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'>
|
||||
* @defaultValue true
|
||||
*/
|
||||
portal?: boolean
|
||||
/**
|
||||
* The key used to get the label from the item.
|
||||
* @defaultValue 'label'
|
||||
*/
|
||||
labelKey?: string
|
||||
class?: any
|
||||
ui?: PartialString<typeof dropdownMenu.slots>
|
||||
}
|
||||
@@ -78,7 +83,8 @@ import UDropdownMenuContent from './DropdownMenuContent.vue'
|
||||
|
||||
const props = withDefaults(defineProps<DropdownMenuProps<T>>(), {
|
||||
portal: true,
|
||||
modal: true
|
||||
modal: true,
|
||||
labelKey: 'label'
|
||||
})
|
||||
const emits = defineEmits<DropdownMenuEmits>()
|
||||
const slots = defineSlots<DropdownMenuSlots<T>>()
|
||||
@@ -106,6 +112,7 @@ const ui = computed(() => dropdownMenu({
|
||||
v-bind="contentProps"
|
||||
:items="items"
|
||||
:portal="portal"
|
||||
:label-key="labelKey"
|
||||
>
|
||||
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
|
||||
<slot :name="name" v-bind="slotData" />
|
||||
|
||||
Reference in New Issue
Block a user