06ddb6662a
Port HeroUI menu family and Dropdown from ce90ea3: Reka DropdownMenu base, MenuKey[] selection with section owners, 17 official demos, dropdown docs and B01 tests. Long-press stays demo-level; submenu close is level-scoped.
71 lines
2.3 KiB
Vue
71 lines
2.3 KiB
Vue
<script setup lang="ts">
|
|
import { IconLogout, IconSettings, IconUsers } from "@tabler/icons-vue";
|
|
import {
|
|
DropdownRoot,
|
|
DropdownTrigger,
|
|
DropdownPopover,
|
|
DropdownMenu,
|
|
DropdownItem,
|
|
Avatar,
|
|
AvatarImage,
|
|
AvatarFallback,
|
|
Label,
|
|
} from "@heroui-vue/components";
|
|
</script>
|
|
<template>
|
|
<DropdownRoot>
|
|
<DropdownTrigger class="rounded-full">
|
|
<Avatar>
|
|
<AvatarImage
|
|
alt="Junior Garcia"
|
|
src="https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/avatars/orange.jpg"
|
|
/>
|
|
<AvatarFallback :delay-ms="600">JD</AvatarFallback>
|
|
</Avatar>
|
|
</DropdownTrigger>
|
|
<DropdownPopover>
|
|
<div class="px-3 pt-3 pb-1">
|
|
<div class="flex items-center gap-2">
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
alt="Jane"
|
|
src="https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/avatars/orange.jpg"
|
|
/>
|
|
<AvatarFallback :delay-ms="600">JD</AvatarFallback>
|
|
</Avatar>
|
|
<div class="flex flex-col gap-0">
|
|
<p class="text-sm leading-5 font-medium">Jane Doe</p>
|
|
<p class="text-xs leading-none text-muted">jane@example.com</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<DropdownMenu>
|
|
<DropdownItem id="dashboard" text-value="仪表盘">
|
|
<Label>仪表盘</Label>
|
|
</DropdownItem>
|
|
<DropdownItem id="profile" text-value="个人资料">
|
|
<Label>个人资料</Label>
|
|
</DropdownItem>
|
|
<DropdownItem id="settings" text-value="设置">
|
|
<div class="flex w-full items-center justify-between gap-2">
|
|
<Label>设置</Label>
|
|
<IconSettings class="size-3.5 text-muted" />
|
|
</div>
|
|
</DropdownItem>
|
|
<DropdownItem id="new-project" text-value="新建项目">
|
|
<div class="flex w-full items-center justify-between gap-2">
|
|
<Label>创建团队</Label>
|
|
<IconUsers class="size-3.5 text-muted" />
|
|
</div>
|
|
</DropdownItem>
|
|
<DropdownItem id="logout" text-value="退出登录" variant="danger">
|
|
<div class="flex w-full items-center justify-between gap-2">
|
|
<Label>退出登录</Label>
|
|
<IconLogout class="size-3.5 text-danger" />
|
|
</div>
|
|
</DropdownItem>
|
|
</DropdownMenu>
|
|
</DropdownPopover>
|
|
</DropdownRoot>
|
|
</template>
|