043a5418f3
- menu-item.css keys disabled styling off the presence attribute Reka emits. - Dropdown surfaces drive the ported enter/exit animations and use data-side for placement-specific motion. - One role=menu per popup; items render their key as DOM id; submenu surfaces point aria-labelledby at the real trigger; MenuSection names its group from a nested Header. - Custom (asChild) triggers stay keyboard focusable; library Button/Avatar keep their own layout instead of the custom-trigger rules. - Items emit data-focused/data-hovered/data-pressed, expose the upstream render props to slots, and merge caller classes through tailwind-variants. - Submenu triggers declare hasSubmenu explicitly and forward class/ARIA; the default submenu indicator uses the baseline chevron artwork. - Demos restore Kbd slot="keyboard" (27x), IconSquarePlus, and remove the added comment, stray space and duplicated indicator SVGs. - Document the page after the official structure and API tables, including renamed props, Vue extensions and remaining gaps.
36 lines
986 B
Vue
36 lines
986 B
Vue
<script setup lang="ts">
|
|
import {
|
|
DropdownRoot,
|
|
DropdownTrigger,
|
|
DropdownPopover,
|
|
DropdownMenu,
|
|
DropdownItem,
|
|
Button,
|
|
Label,
|
|
} from "@heroui-vue/components";
|
|
</script>
|
|
|
|
<template>
|
|
<DropdownRoot trigger="longPress">
|
|
<DropdownTrigger>
|
|
<Button aria-label="菜单" variant="secondary">长按</Button>
|
|
</DropdownTrigger>
|
|
<DropdownPopover>
|
|
<DropdownMenu>
|
|
<DropdownItem id="new-file" text-value="新建文件">
|
|
<Label>新建文件</Label>
|
|
</DropdownItem>
|
|
<DropdownItem id="open-file" text-value="打开文件">
|
|
<Label>打开文件</Label>
|
|
</DropdownItem>
|
|
<DropdownItem id="save-file" text-value="保存文件">
|
|
<Label>保存文件</Label>
|
|
</DropdownItem>
|
|
<DropdownItem id="delete-file" text-value="删除文件" variant="danger">
|
|
<Label>删除文件</Label>
|
|
</DropdownItem>
|
|
</DropdownMenu>
|
|
</DropdownPopover>
|
|
</DropdownRoot>
|
|
</template>
|