docs(dropdown-menu): update

This commit is contained in:
Benjamin Canac
2024-08-06 16:45:07 +02:00
parent 8d560bdd21
commit 39a63e8e3f
11 changed files with 485 additions and 48 deletions

View File

@@ -3,7 +3,7 @@ const items = [{
label: 'Home',
to: '/'
}, {
slot: 'dropdown' as const,
slot: 'dropdown',
icon: 'i-heroicons-ellipsis-horizontal',
children: [{
label: 'Documentation'

View File

@@ -0,0 +1,23 @@
<script setup lang="ts">
const items = [{
label: 'Profile',
icon: 'i-heroicons-user',
slot: 'profile'
}, {
label: 'Billing',
icon: 'i-heroicons-credit-card'
}, {
label: 'Settings',
icon: 'i-heroicons-cog'
}]
</script>
<template>
<UDropdownMenu :items="items" class="w-48">
<UButton label="Open" color="gray" variant="outline" icon="i-heroicons-bars-3" />
<template #profile-trailing>
<UIcon name="i-heroicons-check-badge" class="shrink-0 size-5 text-primary-500 dark:text-primary-400" />
</template>
</UDropdownMenu>
</template>

View File

@@ -0,0 +1,24 @@
<script setup lang="ts">
const open = ref(true)
defineShortcuts({
o: () => open.value = !open.value
})
const items = [{
label: 'Profile',
icon: 'i-heroicons-user'
}, {
label: 'Billing',
icon: 'i-heroicons-credit-card'
}, {
label: 'Settings',
icon: 'i-heroicons-cog'
}]
</script>
<template>
<UDropdownMenu v-model:open="open" :items="items" class="w-48">
<UButton label="Open" color="gray" variant="outline" icon="i-heroicons-bars-3" />
</UDropdownMenu>
</template>