mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 00:40:34 +01:00
feat(DropdownMenu/ContextMenu): handle color field in items (#2510)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
const items = [
|
||||
[
|
||||
{
|
||||
label: 'View',
|
||||
icon: 'i-heroicons-eye'
|
||||
},
|
||||
{
|
||||
label: 'Copy',
|
||||
icon: 'i-heroicons-document-duplicate'
|
||||
},
|
||||
{
|
||||
label: 'Edit',
|
||||
icon: 'i-heroicons-pencil'
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
label: 'Delete',
|
||||
color: 'error' as const,
|
||||
icon: 'i-heroicons-trash'
|
||||
}
|
||||
]
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UDropdownMenu :items="items" class="w-48">
|
||||
<UButton label="Open" color="neutral" variant="outline" icon="i-heroicons-bars-3" />
|
||||
|
||||
<template #profile-trailing>
|
||||
<UIcon name="i-heroicons-check-badge" class="shrink-0 size-5 text-[var(--ui-primary)]" />
|
||||
</template>
|
||||
</UDropdownMenu>
|
||||
</template>
|
||||
Reference in New Issue
Block a user