# Menu

> 用分组、勾选项、单选项和子菜单组织常用操作。

网页来源：/components/menu

版本：@quirekit/ui 0.3.1；源码修订：d79a6b48d00e+worktree。此文档对应当前源码构建，接入方式以开始使用为准。

接入前置：[开始使用](/raw/components/getting-started.md)（Vue、样式、主题与图标 Provider）。

Menu 展示一组即时命令或简单选项。复杂表单使用 Popover，视觉预设使用 PresetGallery，需要确认的任务使用 Dialog。

## 数据配置

直接使用 `<QuireMenu :items="items" @select="onSelect">`，只需为 trigger 插槽提供打开按钮。`QuireKitMenuEntry[]` 支持普通动作、group、submenu、separator 和 radio-group，子项放入 `children`。`icon` 引用注册表，`shortcut`、`disabled`、`reason` 与 `tone` 描述条目。

`checked` 声明勾选项；radio-group 的 `selectedValue` 声明单选值。两者都在右侧显示对号，左侧 `icon` 独立表达功能，不能用勾选项模拟互斥单选。`select(value)` 每次返回一个被执行的叶子值，由调用方更新数据；勾选和单选默认保持菜单打开，`closeOnSelect` 可按项覆盖。分隔项使用稳定 value 和空 label。显式默认插槽优先于 items，适合自定义复杂内容。

### 示例：menu/declarative

文件：`declarative.vue`

```vue
<script setup lang="ts">
import { computed, ref } from "vue";
import { quireIconRegistry } from "@quirekit/ui";
import type { QuireKitMenuEntry } from "@quirekit/ui";
import { QuireIconProvider, QuireButton, QuireMenu } from "@quirekit/ui/vue";

const lastAction = ref("尚未执行");
const compact = ref(false);
const view = ref("page");
const items = computed<readonly QuireKitMenuEntry[]>(() => [
  { value: "document", kind: "group", label: "文档", children: [
    { value: "copy", label: "创建副本", icon: "copy", shortcut: "⌘ D" },
    { value: "export", kind: "submenu", label: "导出格式", children: [
      { value: "pdf", label: "PDF" }, { value: "markdown", label: "Markdown" }
    ] },
    { value: "delete", label: "删除", disabled: true, reason: "只读文档", tone: "danger" }
  ] },
  { value: "divider", label: "", kind: "separator" },
  { value: "compact", label: "紧凑间距", checked: compact.value },
  { value: "view", label: "阅读视图", kind: "radio-group", selectedValue: view.value, children: [
    { value: "page", label: "页面" }, { value: "outline", label: "大纲" }
  ] }
]);
/** @param value - Enabled configured command or option. */
function select(value: string): void {
  lastAction.value = value;
  if (value === "compact") compact.value = !compact.value;
  if (value === "page" || value === "outline") view.value = value;
}
</script>

<template>
  <QuireIconProvider :registry="quireIconRegistry">
  <div class="grid min-h-[180px] place-items-center gap-3 p-8">
    <QuireMenu :items="items" aria-label="声明式文档操作" width="200px" @select="select">
      <template #trigger><QuireButton variant="outline">声明式文档操作</QuireButton></template>
    </QuireMenu>
    <p aria-live="polite" class="m-0 text-qk-helper text-qk-text-secondary">{{ lastAction }}</p>
  </div>
  </QuireIconProvider>
</template>
```

## 基础用法

使用 Item 执行动作，Group 与 Separator 组织条目。`shortcut` 使用共享 Kbd 展示快捷键，实际快捷键由调用方注册。组合键推荐传入 `:shortcut="['Shift', 'Enter']"`，保留字符串形式兼容既有调用。

### 示例：menu/basic

文件：`basic.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import {
  QuireButton,
  QuireIcon,
  QuireMenu,
  QuireMenuGroup,
  QuireMenuItem,
  QuireMenuSeparator
} from "@quirekit/ui/vue";

const lastAction = ref("尚未执行命令");
</script>

<template>
  <div class="grid min-h-[180px] place-items-center gap-3 p-8 text-center">
    <QuireMenu aria-label="文件操作">
      <template #trigger>
        <QuireButton color="neutral" variant="outline">文件操作</QuireButton>
      </template>
      <QuireMenuGroup label="文档" inset>
        <QuireMenuItem value="new" :shortcut="['⌘', 'N']" @select="lastAction = '新建文档'">
          <template #leading><QuireIcon name="fileText" /></template>
          新建文档
        </QuireMenuItem>
        <QuireMenuItem value="duplicate" :shortcut="['⌘', 'D']" @select="lastAction = '创建副本'">
          <template #leading><QuireIcon name="copy" /></template>
          创建副本
        </QuireMenuItem>
      </QuireMenuGroup>
      <QuireMenuSeparator />
      <QuireMenuItem value="print" :shortcut="['⌘', 'P']" inset @select="lastAction = '打印'">
        打印
      </QuireMenuItem>
    </QuireMenu>
    <span aria-live="polite" class="text-qk-helper text-qk-text-tertiary">{{ lastAction }}</span>
  </div>
</template>
```

## Checkbox 选项

CheckboxItem 用于可独立开关的偏好，默认选择后保持菜单打开，方便连续调整。

### 示例：menu/checkbox

文件：`checkbox.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import {
  QuireButton,
  QuireMenu,
  QuireMenuCheckboxItem
} from "@quirekit/ui/vue";

const compactPages = ref(true);
const showComments = ref(false);
</script>

<template>
  <div class="grid min-h-[180px] place-items-center gap-3 p-8 text-center">
    <QuireMenu aria-label="视图选项">
      <template #trigger><QuireButton variant="outline">视图选项</QuireButton></template>
      <QuireMenuCheckboxItem v-model:checked="compactPages" value="compact-pages">
        紧凑页面间距
      </QuireMenuCheckboxItem>
      <QuireMenuCheckboxItem v-model:checked="showComments" value="show-comments">
        显示评论
      </QuireMenuCheckboxItem>
    </QuireMenu>
    <span class="text-qk-helper text-qk-text-tertiary">
      紧凑间距：{{ compactPages ? "开启" : "关闭" }} · 评论：{{ showComments ? "显示" : "隐藏" }}
    </span>
  </div>
</template>
```

## Radio 选项

RadioGroup 管理一组互斥选项，RadioItem 显示当前选择。

### 示例：menu/radio

文件：`radio.vue`

```vue
<script setup lang="ts">
import { computed, ref } from "vue";
import {
  QuireButton,
  QuireMenu,
  QuireMenuRadioGroup,
  QuireMenuRadioItem
} from "@quirekit/ui/vue";

const sortOrder = ref("updated");
const sortOrderLabel = computed(() => ({
  created: "创建时间",
  title: "标题",
  updated: "最近更新"
})[sortOrder.value]);
</script>

<template>
  <div class="grid min-h-[180px] place-items-center gap-3 p-8 text-center">
    <QuireMenu aria-label="排序方式">
      <template #trigger><QuireButton variant="outline">排序方式</QuireButton></template>
      <QuireMenuRadioGroup v-model="sortOrder" label="排序">
        <QuireMenuRadioItem value="updated">最近更新</QuireMenuRadioItem>
        <QuireMenuRadioItem value="created">创建时间</QuireMenuRadioItem>
        <QuireMenuRadioItem value="title">标题</QuireMenuRadioItem>
      </QuireMenuRadioGroup>
    </QuireMenu>
    <span class="text-qk-helper text-qk-text-tertiary">当前排序：{{ sortOrderLabel }}</span>
  </div>
</template>
```

## 禁用与危险动作

`disabled` 条目保留标签和说明，但不参与键盘导航或执行。`tone="danger"` 突出危险动作；需要确认时，在选择后打开 Dialog。

### 示例：menu/states

文件：`states.vue`

```vue
<script setup lang="ts">
import {
  QuireButton,
  QuireIcon,
  QuireMenu,
  QuireMenuItem,
  QuireMenuSeparator
} from "@quirekit/ui/vue";
</script>

<template>
  <div class="grid justify-items-start p-qk-surface">
    <QuireMenu aria-label="成员操作">
      <template #trigger><QuireButton variant="outline">成员操作</QuireButton></template>
      <QuireMenuItem value="profile">查看资料</QuireMenuItem>
      <QuireMenuItem value="owner" disabled>移交所有权（仅管理员）</QuireMenuItem>
      <QuireMenuSeparator />
      <QuireMenuItem value="remove" tone="danger">
        <template #leading><QuireIcon name="trash" /></template>
        移出团队
      </QuireMenuItem>
    </QuireMenu>
  </div>
</template>
```

## 子菜单

使用 `QuireMenuSubmenu` 组织次级操作。用户可通过指针或方向键进入，并使用 ArrowLeft 返回父菜单。
手工组合条目时，在对应子菜单上监听 `@select` 可取得本层执行的条目值，包含再次选择当前单选项。
需要每次执行设置时使用该事件；只关心单选值变化时，监听单选组的 `v-model` 即可。

### 示例：menu/submenu

文件：`submenu.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import {
  QuireButton,
  QuireMenu,
  QuireMenuItem,
  QuireMenuSubmenu
} from "@quirekit/ui/vue";
const selected = ref("");
const labels: Readonly<Record<string, string>> = { image: "图片", "table-2": "2 × 2 表格", "table-4": "4 × 4 表格", "custom-table": "自定义表格…" };
</script>

<template>
  <div class="grid justify-items-start gap-qk-group p-qk-surface">
    <QuireMenu aria-label="插入内容" @select="selected = $event">
      <template #trigger><QuireButton variant="outline">插入内容</QuireButton></template>
      <QuireMenuItem value="image">图片</QuireMenuItem>
      <QuireMenuSubmenu width="220px" @select="selected = $event">
        <template #trigger>表格</template>
        <QuireMenuItem value="table-2">2 × 2 表格</QuireMenuItem>
        <QuireMenuItem value="table-4">4 × 4 表格</QuireMenuItem>
        <QuireMenuItem value="custom-table">自定义表格…</QuireMenuItem>
      </QuireMenuSubmenu>
    </QuireMenu>
    <p role="status">{{ selected ? `已选择：${labels[selected]}` : "选择要插入的内容" }}</p>
  </div>
</template>
```

## 内容宽度

默认宽度为 `200px`。`width` 指定固定宽度，`width="auto"` 按内容收缩；`minWidth` 与 `maxWidth` 可以单独使用或组合成范围。子菜单使用相同属性。

达到宽度上限时，标签显示省略号，选中标记、快捷键和子菜单图标保持可见。所有传送到页面的 Menu
都受当前视口宽高约束，空间不足时自动翻转或沿边缘滑动；长列表独立滚动，系统滚动条不改变条目列对齐。
子菜单与根菜单使用相同的视口定位，纵向对齐入口行，横向与父菜单外边缘保持 6px 间隔，
不因传送容器的位置滚动整页。空间不足时翻转到另一侧或沿纵向调整；宽度受该侧可用空间约束，
不会为贴合视口而覆盖父菜单。子菜单的浮层层级始终高于父菜单，不依赖传送节点的挂载顺序。
总高度默认不超过动态视口的 60%，并取锚点可用高度中的较小值；短菜单仍按内容收缩。
该预算与 Popover 共用，见[浮层尺寸边界](/raw/design/layout.md#浮层尺寸边界)。

### 示例：menu/sizing

文件：`sizing.vue`

```vue
<script setup lang="ts">
import { QuireButton, QuireMenu, QuireMenuItem } from "@quirekit/ui/vue";
</script>

<template>
  <div class="flex min-h-[180px] flex-wrap items-center justify-center gap-3 p-8">
    <QuireMenu aria-label="固定宽度" width="280px">
      <template #trigger><QuireButton variant="outline">固定 280 px</QuireButton></template>
      <QuireMenuItem value="team">整个产品设计与研发协作团队</QuireMenuItem>
      <QuireMenuItem value="private">仅自己</QuireMenuItem>
    </QuireMenu>
    <QuireMenu aria-label="内容宽度" width="auto" min-width="180px" max-width="240px">
      <template #trigger><QuireButton variant="outline">内容宽度</QuireButton></template>
      <QuireMenuItem value="short">短标签</QuireMenuItem>
      <QuireMenuItem value="long">达到上限后对超长菜单标签使用省略号</QuireMenuItem>
    </QuireMenu>
  </div>
</template>
```

## 受控状态与位置

`v-model:open` 控制打开状态，并同步选择、Escape 和外部点击。`placement` 指定首选位置，组件根据可用空间调整最终位置。

宿主有独立浮层容器时可设置 `portalTarget`（元素或选择器）；嵌套子菜单自动继承同一目标，
不同菜单根的挂载目标互不影响。默认仍挂载到 `body`。
菜单内容可以组合 `QuireScrollArea`：键盘导航和前缀搜索改变高亮条目时，公共 Menu 会让内层
滚动区显示该条目，不滚动文档。该同步只观察已挂载菜单的活动条目，关闭时释放。

宿主已有定位与可视边界管理时，使用 `:positioned="false" :portalled="false"`，通过 `style` 为菜单内容指定坐标和最大尺寸。Menu 保留主题、条目、键盘导航和关闭行为；坐标改变不播放位移动画。

### 示例：menu/controlled

文件：`controlled.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import { QuireButton, QuireMenu, QuireMenuItem } from "@quirekit/ui/vue";

const open = ref(false);
</script>

<template>
  <div class="grid min-h-[180px] place-items-center gap-3 p-8 text-center">
    <QuireMenu v-model:open="open" aria-label="受控菜单" placement="top-start">
      <template #trigger><QuireButton variant="outline">受控菜单</QuireButton></template>
      <QuireMenuItem value="rename">重命名</QuireMenuItem>
      <QuireMenuItem value="archive">归档</QuireMenuItem>
    </QuireMenu>
    <span class="text-qk-helper text-qk-text-tertiary">当前状态：{{ open ? "已打开" : "已关闭" }}</span>
  </div>
</template>
```

### 示例：menu/host-positioned

文件：`host-positioned.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import { QuireButton, QuireMenu, QuireMenuItem, QuireToolbar, QuireToolbarToggle, QuireIcon } from "@quirekit/ui/vue";

const open = ref(false);
const bold = ref(false);
</script>

<template>
  <div class="relative min-h-[220px] p-4">
    <QuireMenu
      v-model:open="open"
      initial-focus="menu"
      :positioned="false"
      :portalled="false"
      aria-label="文档操作"
      width="220px"
      :style="{ position: 'absolute', insetInlineStart: '16px', top: '56px', maxWidth: 'calc(100% - 32px)' }"
    >
      <template #trigger><QuireButton variant="outline">文档操作</QuireButton></template>
      <QuireToolbar label="快速排版" overflow="visible" align="start">
        <QuireToolbarToggle v-model="bold" label="加粗"><QuireIcon name="bold" /></QuireToolbarToggle>
      </QuireToolbar>
      <QuireMenuItem value="copy">复制</QuireMenuItem>
      <QuireMenuItem value="rename">重命名</QuireMenuItem>
      <QuireMenuItem value="export">导出</QuireMenuItem>
    </QuireMenu>
  </div>
</template>
```

## 条目与分组

分组标题使用较小字号、辅助色和紧凑留白，组内操作向内缩进，便于区分标题与命令。
标题不响应操作，也不进入键盘导航；省略标题的分组不增加缩进。

- `QuireMenuItem @select` 处理当前条目的执行；根组件的 `@select(value)` 可统一接收所选值。指针与键盘操作触发相同事件，禁用项不会触发。
- 普通 Item 默认执行后关闭；CheckboxItem 默认保持打开。
- 使用 `leading` 插槽添加图标。无图标条目或分组标题需要与图标列对齐时，设置 `inset`。
- 分组标题也有 `leading` 与 `trailing` 插槽：前者放这一组的标记（如来源图标），后者放一小段状态（如“已登录”）。标题文字过长时先省略标题，状态完整显示；两个插槽都只是装饰，键盘导航与可访问名称仍只用 `label`。
- Item、CheckboxItem 与 RadioItem 的 `description` 在标签下方显示一行简短说明，条目高度随之增加；说明只补充标签未表达的结果，不重复解释标签左侧图标与右侧对号对齐标签所在的第一行，不在两行之间居中。
- Checkbox 与 Radio 条目始终在右侧为对号保留位置，快捷键位于对号之前；`leading` 插槽和 `inset` 管理独立的左侧图标列。单选/多选语义及键盘行为不因对号外观一致而改变。
- 单一设置菜单可使用空的 radio-group `label` 隐藏重复标题，同时为 Menu 提供可访问名称；多个设置组使用可见标题区分。
- 菜单和子菜单可以放在 Dialog 或 Drawer 中，关闭子菜单后返回父菜单的入口行；父菜单含内嵌工具栏或字段时，仍可直接用 ArrowRight 再次进入子菜单。

### 示例：menu/group-status

文件：`group-status.vue`

```vue
<script setup lang="ts">
import { ref } from "vue";
import { QuireButton, QuireMenu, QuireMenuGroup, QuireMenuItem, QuireMenuSeparator } from "@quirekit/ui/vue";

/** Model chosen in the menu. */
const model = ref("sonnet");
</script>

<template>
  <div class="grid min-h-[220px] place-items-center p-8">
    <!-- Each group is one source: its mark before the title, its sign-in state after it. -->
    <QuireMenu aria-label="选择模型">
      <template #trigger>
        <QuireButton color="neutral" variant="outline">模型：{{ model }}</QuireButton>
      </template>
      <QuireMenuGroup label="写作助手">
        <template #leading><span class="font-qk-control text-qk-helper">AI</span></template>
        <QuireMenuItem value="default" @select="model = 'default'">默认模型</QuireMenuItem>
      </QuireMenuGroup>
      <QuireMenuGroup label="本机助手">
        <template #leading><span class="font-qk-control text-qk-helper">C</span></template>
        <template #trailing>已登录</template>
        <QuireMenuItem value="sonnet" @select="model = 'sonnet'">Sonnet</QuireMenuItem>
        <QuireMenuItem value="opus" @select="model = 'opus'">Opus</QuireMenuItem>
      </QuireMenuGroup>
      <QuireMenuSeparator />
      <QuireMenuItem value="manage">管理助手…</QuireMenuItem>
    </QuireMenu>
  </div>
</template>
```

## 键盘操作

菜单默认将初始焦点交给内嵌的搜索框等可聚焦控件。设置 `initial-focus="menu"` 可让焦点先
落在菜单本身，适用于包含图标工具栏、希望打开时不触发按钮提示的菜单；Tab 仍可进入内嵌控件。

| 按键 | 行为 |
| --- | --- |
| ArrowUp / ArrowDown | 在可用条目之间移动。 |
| Home / End | 到达首个或末个可用条目。 |
| Enter / Space | 执行动作或切换选项。 |
| ArrowRight / ArrowLeft | 进入或离开子菜单。 |
| Escape | 关闭菜单并恢复入口焦点。 |
| 字符键 | 按条目标签查找。 |

## 打开对话框

菜单动作可以打开重命名或确认对话框。将 Dialog 放在菜单外部，避免菜单关闭时一起卸载；通过 `finalFocusEl` 将最终焦点返回菜单按钮。

### 示例：menu/dialog

文件：`dialog.vue`

```vue
<script setup lang="ts">
import { nextTick, ref, useId } from "vue";
import { QuireButton, QuireDialogCloseTrigger, QuireDialogContent, QuireDialogRoot, QuireField, QuireInput, QuireMenu, QuireMenuItem } from "@quirekit/ui/vue";

const menuOpen = ref(false);
const dialogOpen = ref(false);
const savedName = ref("季度产品计划");
const draft = ref(savedName.value);
const triggerHost = ref<HTMLDivElement>();
const formElement = ref<HTMLFormElement>();
const formId = `menu-task-form-${useId()}`;

/** 打开任务前从已保存值建立草稿，等待菜单关闭的 DOM 更新完成。 */
async function rename(): Promise<void> {
  draft.value = savedName.value;
  menuOpen.value = false;
  await nextTick();
  dialogOpen.value = true;
}

/** @returns 任务输入控件，或挂载前的 null。 */
function initialFocus(): HTMLElement | null {
  return formElement.value?.querySelector("input") ?? null;
}

/** @returns 关闭任务后仍在页面中的菜单入口。 */
function finalFocus(): HTMLElement | null {
  return triggerHost.value?.querySelector("button") ?? null;
}

/** 提交有效本地草稿并关闭任务。 */
function save(): void {
  if (!draft.value.trim()) return;
  savedName.value = draft.value.trim();
  dialogOpen.value = false;
}
</script>

<template>
  <div class="grid min-h-[200px] place-items-center gap-3 p-8">
    <div ref="triggerHost">
      <QuireMenu v-model:open="menuOpen" aria-label="文档任务">
        <template #trigger><QuireButton variant="outline">文档任务</QuireButton></template>
        <QuireMenuItem value="rename" @select="rename">重命名…</QuireMenuItem>
      </QuireMenu>
    </div>
    <p class="m-0 max-w-full break-words text-qk-helper text-qk-text-secondary" role="status">已保存：{{ savedName }}</p>
    <!-- Dialog outlives the menu item so its final focus target remains valid. -->
    <QuireDialogRoot v-model:open="dialogOpen" :initial-focus-el="initialFocus" :final-focus-el="finalFocus">
      <QuireDialogContent title="修改文档名称" description="取消保留原名称，保存更新当前示例。" size="mini" height="auto">
        <form :id="formId" ref="formElement" @submit.prevent="save">
          <QuireField label="新文档名称" width="100%" required>
            <template #default="{ controlProps }"><QuireInput v-bind="controlProps" v-model="draft" width="100%" /></template>
          </QuireField>
        </form>
        <template #footer>
          <QuireDialogCloseTrigger as-child><QuireButton variant="outline">取消重命名</QuireButton></QuireDialogCloseTrigger>
          <QuireButton type="submit" :form="formId" :disabled="!draft.trim()">保存名称</QuireButton>
        </template>
      </QuireDialogContent>
    </QuireDialogRoot>
  </div>
</template>
```

右键操作使用 [ContextMenu](/raw/components/context-menu.md)。

QuireMenuSubmenu 的 `triggerClass` 与 `contentClass` 分别附加到子菜单入口和内容根节点，适合组合多行操作或调整触控密度。需要自动切换到底部操作面板时，使用 [ActionMenu](/raw/components/action-menu.md)。

## 坐标菜单与多实例

普通 HTML 属性应用到菜单内容，触发器属性放在 `trigger` 插槽的按钮上。多个独立 Vue 应用应设置不同的 `app.config.idPrefix`，避免重复 ID。

`anchorPoint` 接收视口 CSS 像素坐标 `{ x, y }`，适合 Canvas/SVG 等已经完成命中的交互打开菜单。
坐标型 Menu 使用 fixed 视口定位，每个新坐标建立新的定位生命周期，不能先用 `(0, 0)` 占位再打开。
宿主负责转换业务坐标并在关闭后安排焦点返回。常规 DOM 右键操作直接使用 ContextMenu。

## 声明式菜单与内联列表

`QuireMenuItems` 使用 `QuireKitMenuEntry[]` 描述条目、分组和子菜单，通过 `select(value)` 处理动作。`leading` 插槽添加静态图标或色块，`contentProps` 配置子菜单内容。

`QuireCommandList` 用于已存在浮层中的常驻命令列表，支持上下方向键和 Home / End；不要再套一层 Menu。条目的 `group` 为相邻同组命令添加一次轻量标题，标题不进入键盘导航；`description` 在标签旁显示辅助说明，并通过 `aria-describedby` 关联。`leading` 可放图标，列表激活时仍只发出稳定的 `key`。组合示例见 [Chat Composer](/raw/components/chat-composer.md#工作区面板)。

搜索输入或编辑器需要保留焦点时，把真实输入元素传给 `focusOwner`，并将原生 `keydown`
转发到模板引用的 `handleKeydown(event)`。列表负责高亮、滚动和 `aria-activedescendant`，
不会聚焦条目；返回 `true` 表示已处理。输入法组合键、带修饰键的输入继续交给原控件。
筛选由宿主负责，取消由外层浮层负责；卸载后恢复输入原有的 ARIA 属性。

### 示例：menu/external-focus

文件：`external-focus.vue`

```vue
<script setup lang="ts">
import { computed, ref, shallowRef } from "vue";
import { QuireCommandList, QuireInput, type QuireKitCommandListHandle } from "@quirekit/ui/vue";
const query = ref(""), selected = ref(""), owner = shallowRef<HTMLElement>();
const list = shallowRef<QuireKitCommandListHandle>();
const items = computed(() => [{ key: "paragraph", label: "正文" }, { key: "heading", label: "标题" }, { key: "table", label: "表格" }]
  .filter(item => `${item.key} ${item.label}`.includes(query.value)));
/** @param event - Native input focus; the input remains the keyboard owner. */
function focus(event: FocusEvent): void { owner.value = event.target as HTMLElement; }
</script>
<template>
  <div class="grid max-w-sm gap-qk-inline p-qk-surface">
    <QuireInput v-model="query" aria-label="搜索内容" placeholder="搜索内容" width="100%" @focus="focus" @keydown="list?.handleKeydown($event)" />
    <QuireCommandList ref="list" label="插入内容" :items="items" :focus-owner="owner" @select="selected = $event" />
    <p role="status" class="m-0 text-qk-helper text-qk-text-secondary">{{ selected ? `已选择：${selected}` : '在输入框中按上下方向键选择，Enter 确认。' }}</p>
  </div>
</template>
```



## API

### QuireMenu

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| items | 否 | — | Ordered declarative entries; the default slot takes precedence when supplied. |
| anchorPoint | 否 | — | Screen point for controlled semantic menus without a DOM trigger. |
| portalTarget | 否 | — | Owning document container for the floating surface. |
| id | 否 | — | 菜单的稳定标识，用于关联入口与内容。 |
| ariaLabel | 否 | — | Accessible name announced for the menu content. |
| defaultOpen | 否 | false | Initial open state when the controlled open value is omitted. |
| initialFocus | 否 | "auto" | Whether opening focuses an embedded control or the menu navigation surface. |
| closeOnSelect | 否 | true | Whether selecting an ordinary item closes the menu. |
| loopFocus | 否 | true | Whether ArrowDown from the final row returns to the first available row. |
| typeahead | 否 | true | Whether printable keys move highlight by label prefix. |
| placement | 否 | "bottom-start" | Preferred placement around the trigger. |
| portalled | 否 | true | Whether the floating positioner teleports to the document body. |
| positioned | 否 | true | Whether Menu owns floating placement; false lets a host position the public surface. |
| width | 否 | — | Fixed content width; use \`auto\` to size directly from content. |
| minWidth | 否 | — | Minimum content width that may continue growing with its rows. |
| maxWidth | 否 | — | Maximum content width after which labels truncate with an ellipsis. |
| open | 否 | undefined |  |

**items**

```ts
readonly QuireKitMenuEntry[] | undefined
```

```ts
undefined | readonly ({
  /** Stable identity emitted for executable rows. */
  value: string;
  /** Localized visible label. */
  label: string;
  /** Group, submenu or ordinary action. */
  kind?: undefined | "group" | "item" | "submenu" | "separator" | "radio-group";
  /** Ordered rows belonging to a group or submenu. */
  children?: readonly QuireKitMenuEntry[] | undefined;
  /** Whether activation is unavailable. */
  disabled?: boolean | undefined;
  /** Optional explanation of an unavailable action. */
  reason?: undefined | string;
  /** Shortcut rendered with Kbd; pass explicit keys for combined shortcuts, or a legacy display string. */
  shortcut?: undefined | string | readonly (string)[];
  /** Icon name resolved by the current QuireIconProvider. */
  icon?: string | undefined;
  /** Current value of a radio group; its children describe the options. */
  selectedValue?: string | undefined;
  /** Whether activating a leaf closes the menu; checkboxes and radio items default to false. */
  closeOnSelect?: boolean | undefined;
  /** Checked state for a toggle row; omission is an ordinary action. */
  checked?: boolean | undefined;
  /** Visual action emphasis. */
  tone?: undefined | "neutral" | "danger";
})[]
```

**anchorPoint**

```ts
QuireKitMenuAnchorPoint | undefined
```

```ts
undefined | {
  /** Horizontal coordinate in CSS viewport pixels. */
  x: number;
  /** Vertical coordinate in CSS viewport pixels. */
  y: number;
}
```

**portalTarget**

```ts
string | HTMLElement | undefined
```

```ts
undefined | string | HTMLElement
```

**id**

```ts
string | undefined
```

```ts
undefined | string
```

**ariaLabel**

```ts
string | undefined
```

```ts
undefined | string
```

**defaultOpen**

```ts
boolean | undefined
```

**initialFocus**

```ts
QuireKitMenuInitialFocus | undefined
```

```ts
undefined | "auto" | "menu"
```

**closeOnSelect**

```ts
boolean | undefined
```

**loopFocus**

```ts
boolean | undefined
```

**typeahead**

```ts
boolean | undefined
```

**placement**

```ts
MenuPlacement | undefined
```

```ts
undefined | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"
```

**portalled**

```ts
boolean | undefined
```

**positioned**

```ts
boolean | undefined
```

**width**

```ts
QuireKitMenuLength | undefined
```

```ts
undefined | string | number
```

**minWidth**

```ts
QuireKitMenuLength | undefined
```

```ts
undefined | string | number
```

**maxWidth**

```ts
QuireKitMenuLength | undefined
```

```ts
undefined | string | number
```

**open**

```ts
boolean | undefined
```

#### Events

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| update\:open | 否 | — |  |
| select | 否 | — |  |
| highlightChange | 否 | — |  |

**update:open**

```ts
[value: boolean | undefined]
```

**select**

```ts
[value: string]
```

**highlightChange**

```ts
[value: string | null]
```

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| trigger | 否 | — | Single interactive element that opens the menu. |
| default | 否 | — | Menu groups, rows, separators, and nested menus. |

**trigger**

```ts
any
```

**default**

```ts
any
```

#### 公开实例成员

无。

#### 相关类型

```ts
type QuireKitMenuEntry = {
  /** Stable identity emitted for executable rows. */
  value: string;
  /** Localized visible label. */
  label: string;
  /** Group, submenu or ordinary action. */
  kind?: undefined | "group" | "item" | "submenu" | "separator" | "radio-group";
  /** Ordered rows belonging to a group or submenu. */
  children?: readonly QuireKitMenuEntry[] | undefined;
  /** Whether activation is unavailable. */
  disabled?: boolean | undefined;
  /** Optional explanation of an unavailable action. */
  reason?: undefined | string;
  /** Shortcut rendered with Kbd; pass explicit keys for combined shortcuts, or a legacy display string. */
  shortcut?: undefined | string | readonly (string)[];
  /** Icon name resolved by the current QuireIconProvider. */
  icon?: string | undefined;
  /** Current value of a radio group; its children describe the options. */
  selectedValue?: string | undefined;
  /** Whether activating a leaf closes the menu; checkboxes and radio items default to false. */
  closeOnSelect?: boolean | undefined;
  /** Checked state for a toggle row; omission is an ordinary action. */
  checked?: boolean | undefined;
  /** Visual action emphasis. */
  tone?: undefined | "neutral" | "danger";
};
```

```ts
type QuireKitMenuAnchorPoint = {
  /** Horizontal coordinate in CSS viewport pixels. */
  x: number;
  /** Vertical coordinate in CSS viewport pixels. */
  y: number;
};
```

### QuireMenuItem

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| value | 是 | — | Stable value emitted when the item is activated. |
| tone | 否 | "neutral" | Visual role of the action without changing its interaction behavior. |
| shortcut | 否 | — | Optional keyboard shortcut rendered in the trailing metadata column. |
| disabled | 否 | false | Whether pointer and keyboard activation are unavailable. |
| closeOnSelect | 否 | true | Whether activating this row closes the owning menu. |
| inset | 否 | false | Whether an icon-free row reserves the leading indicator column. |
| description | 否 | — | Optional one-line explanation shown under the label; the row grows to fit it. |

**value**

```ts
string
```

**tone**

```ts
QuireKitMenuItemTone | undefined
```

```ts
undefined | "neutral" | "danger"
```

**shortcut**

```ts
string | readonly string[] | undefined
```

```ts
undefined | string | readonly (string)[]
```

**disabled**

```ts
boolean | undefined
```

**closeOnSelect**

```ts
boolean | undefined
```

**inset**

```ts
boolean | undefined
```

**description**

```ts
string | undefined
```

```ts
undefined | string
```

#### Events

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| select | 否 | — |  |

**select**

```ts
[]
```

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| default | 否 | — | Visible item label. |
| leading | 否 | — | Optional leading icon. |
| trailing | 否 | — | Optional trailing content that replaces the shortcut prop. |

**default**

```ts
any
```

**leading**

```ts
any
```

**trailing**

```ts
any
```

#### 公开实例成员

无。

### QuireMenuGroup

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| id | 否 | — | Stable group identity used by accessible relationships. |
| label | 否 | — | Optional visible label shown above the group rows. |
| inset | 否 | false | Whether the label aligns with rows that reserve an indicator column. |

**id**

```ts
string | undefined
```

```ts
undefined | string
```

**label**

```ts
string | undefined
```

```ts
undefined | string
```

**inset**

```ts
boolean | undefined
```

#### Events

无。

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| default | 否 | — | Rows contained by this visual and semantic group. |
| leading | 否 | — | Decorative mark before the label, such as the icon of the source the rows belong to. |
| trailing | 否 | — | Short status after the label, such as a signed-in state; it is not read as part of the label. |

**default**

```ts
any
```

**leading**

```ts
any
```

**trailing**

```ts
any
```

#### 公开实例成员

无。

### QuireMenuCheckboxItem

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| value | 是 | — | 选项的稳定唯一值。 |
| checked | 是 | — |  |
| tone | 否 | "neutral" | Visual role of the option without changing its checked behavior. |
| shortcut | 否 | — | Optional keyboard shortcut rendered in the trailing metadata column. |
| disabled | 否 | false | Whether pointer and keyboard changes are unavailable. |
| closeOnSelect | 否 | false | Whether changing the option closes the owning menu. |
| inset | 否 | false | Whether an icon-free option reserves the independent leading icon column. |
| description | 否 | — | Optional one-line explanation shown under the label; the row grows to fit it. |

**value**

```ts
string
```

**checked**

```ts
boolean
```

**tone**

```ts
QuireKitMenuItemTone | undefined
```

```ts
undefined | "neutral" | "danger"
```

**shortcut**

```ts
string | readonly string[] | undefined
```

```ts
undefined | string | readonly (string)[]
```

**disabled**

```ts
boolean | undefined
```

**closeOnSelect**

```ts
boolean | undefined
```

**inset**

```ts
boolean | undefined
```

**description**

```ts
string | undefined
```

```ts
undefined | string
```

#### Events

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| update\:checked | 否 | — |  |

**update:checked**

```ts
[value: boolean]
```

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| default | 否 | — | Visible option label. |
| leading | 否 | — | Optional functional icon, separate from the trailing checked state. |
| trailing | 否 | — | Optional trailing content that replaces the shortcut prop. |

**default**

```ts
any
```

**leading**

```ts
any
```

**trailing**

```ts
any
```

#### 公开实例成员

无。

### QuireMenuRadioGroup

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| modelValue | 是 | — |  |
| id | 否 | — | Stable group identity used by accessible relationships. |
| label | 否 | — | Optional visible label shown above the radio options. |

**modelValue**

```ts
string
```

**id**

```ts
string | undefined
```

```ts
undefined | string
```

**label**

```ts
string | undefined
```

```ts
undefined | string
```

#### Events

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| update\:modelValue | 否 | — |  |

**update:modelValue**

```ts
[value: string]
```

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| default | 否 | — | Radio items belonging to this mutually exclusive option set. |

**default**

```ts
any
```

#### 公开实例成员

无。

### QuireMenuRadioItem

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| value | 是 | — | Stable option value controlled by the owning radio group. |
| shortcut | 否 | — | Optional keyboard shortcut rendered in the trailing metadata column. |
| disabled | 否 | false | Whether pointer and keyboard changes are unavailable. |
| closeOnSelect | 否 | false | Whether selecting this option closes the owning menu. |
| inset | 否 | false | Whether an icon-free option reserves the independent leading icon column. |
| description | 否 | — | Optional one-line explanation shown under the label; the row grows to fit it. |

**value**

```ts
string
```

**shortcut**

```ts
string | readonly string[] | undefined
```

```ts
undefined | string | readonly (string)[]
```

**disabled**

```ts
boolean | undefined
```

**closeOnSelect**

```ts
boolean | undefined
```

**inset**

```ts
boolean | undefined
```

**description**

```ts
string | undefined
```

```ts
undefined | string
```

#### Events

无。

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| default | 否 | — | Visible option label. |
| leading | 否 | — | Optional functional icon, separate from the trailing checked state. |
| trailing | 否 | — | Optional trailing content that replaces the shortcut prop. |

**default**

```ts
any
```

**leading**

```ts
any
```

**trailing**

```ts
any
```

#### 公开实例成员

无。

### QuireMenuSubmenu

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| contentProps | 否 | — | Theme, language and owner attributes for the teleported child content. |
| id | 否 | — | 子菜单的稳定标识。 |
| tone | 否 | "neutral" | Visual role of the submenu trigger row. |
| portalled | 否 | true | Whether the child positioner teleports to the inherited menu portal. |
| inset | 否 | false | Whether an icon-free trigger reserves the leading indicator column. |
| width | 否 | — | Fixed child-menu width; use \`auto\` to size directly from content. |
| minWidth | 否 | — | Minimum child-menu width that may continue growing with its rows. |
| maxWidth | 否 | — | Maximum child-menu width after which labels truncate with an ellipsis. |
| triggerClass | 否 | — | Additional class on the existing submenu trigger row. |
| contentClass | 否 | — | Additional class on the existing child menu surface. |
| open | 否 | undefined |  |

**contentProps**

```ts
HTMLAttributes | undefined
```

```ts
undefined | HTMLAttributes
```

**id**

```ts
string | undefined
```

```ts
undefined | string
```

**tone**

```ts
QuireKitMenuItemTone | undefined
```

```ts
undefined | "neutral" | "danger"
```

**portalled**

```ts
boolean | undefined
```

**inset**

```ts
boolean | undefined
```

**width**

```ts
QuireKitMenuLength | undefined
```

```ts
undefined | string | number
```

**minWidth**

```ts
QuireKitMenuLength | undefined
```

```ts
undefined | string | number
```

**maxWidth**

```ts
QuireKitMenuLength | undefined
```

```ts
undefined | string | number
```

**triggerClass**

```ts
string | undefined
```

```ts
undefined | string
```

**contentClass**

```ts
string | undefined
```

```ts
undefined | string
```

**open**

```ts
boolean | undefined
```

#### Events

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| update\:open | 否 | — |  |
| select | 否 | — |  |

**update:open**

```ts
[value: boolean | undefined]
```

**select**

```ts
[value: string]
```

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| trigger | 否 | — | Visible label of the parent-menu trigger row. |
| leading | 否 | — | Optional leading icon for the trigger row. |
| default | 否 | — | Child menu rows. |

**trigger**

```ts
any
```

**leading**

```ts
any
```

**default**

```ts
any
```

#### 公开实例成员

无。

### QuireMenuItems

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| items | 是 | — | Live localized item tree. |
| contentProps | 否 | — | Owner attributes projected to every teleported child menu. |
| closeOnSelect | 否 | — | Default close policy for ordinary commands. |

**items**

```ts
readonly QuireKitMenuEntry[]
```

```ts
readonly ({
  /** Stable identity emitted for executable rows. */
  value: string;
  /** Localized visible label. */
  label: string;
  /** Group, submenu or ordinary action. */
  kind?: undefined | "group" | "item" | "submenu" | "separator" | "radio-group";
  /** Ordered rows belonging to a group or submenu. */
  children?: undefined | readonly QuireKitMenuEntry[];
  /** Whether activation is unavailable. */
  disabled?: boolean | undefined;
  /** Optional explanation of an unavailable action. */
  reason?: undefined | string;
  /** Shortcut rendered with Kbd; pass explicit keys for combined shortcuts, or a legacy display string. */
  shortcut?: undefined | string | readonly (string)[];
  /** Icon name resolved by the current QuireIconProvider. */
  icon?: string | undefined;
  /** Current value of a radio group; its children describe the options. */
  selectedValue?: string | undefined;
  /** Whether activating a leaf closes the menu; checkboxes and radio items default to false. */
  closeOnSelect?: boolean | undefined;
  /** Checked state for a toggle row; omission is an ordinary action. */
  checked?: boolean | undefined;
  /** Visual action emphasis. */
  tone?: undefined | "neutral" | "danger";
})[]
```

**contentProps**

```ts
HTMLAttributes | undefined
```

```ts
undefined | HTMLAttributes
```

**closeOnSelect**

```ts
boolean | undefined
```

#### Events

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| select | 否 | — |  |

**select**

```ts
[value: string]
```

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| leading | 否 | — | Optional product-owned leading illustration, recursively forwarded to leaves. |

**leading**

```ts
{ item: QuireKitMenuEntry; }
```

```ts
{
  item: {
    /** Stable identity emitted for executable rows. */
    value: string;
    /** Localized visible label. */
    label: string;
    /** Group, submenu or ordinary action. */
    kind?: undefined | "group" | "item" | "submenu" | "separator" | "radio-group";
    /** Ordered rows belonging to a group or submenu. */
    children?: undefined | readonly (QuireKitMenuEntry)[];
    /** Whether activation is unavailable. */
    disabled?: boolean | undefined;
    /** Optional explanation of an unavailable action. */
    reason?: undefined | string;
    /** Shortcut rendered with Kbd; pass explicit keys for combined shortcuts, or a legacy display string. */
    shortcut?: undefined | string | readonly (string)[];
    /** Icon name resolved by the current QuireIconProvider. */
    icon?: string | undefined;
    /** Current value of a radio group; its children describe the options. */
    selectedValue?: string | undefined;
    /** Whether activating a leaf closes the menu; checkboxes and radio items default to false. */
    closeOnSelect?: boolean | undefined;
    /** Checked state for a toggle row; omission is an ordinary action. */
    checked?: boolean | undefined;
    /** Visual action emphasis. */
    tone?: undefined | "neutral" | "danger";
  };
}
```

#### 公开实例成员

无。

#### 相关类型

```ts
type QuireKitMenuEntry = {
  /** Stable identity emitted for executable rows. */
  value: string;
  /** Localized visible label. */
  label: string;
  /** Group, submenu or ordinary action. */
  kind?: undefined | "group" | "item" | "submenu" | "separator" | "radio-group";
  /** Ordered rows belonging to a group or submenu. */
  children?: undefined | readonly (QuireKitMenuEntry)[];
  /** Whether activation is unavailable. */
  disabled?: boolean | undefined;
  /** Optional explanation of an unavailable action. */
  reason?: undefined | string;
  /** Shortcut rendered with Kbd; pass explicit keys for combined shortcuts, or a legacy display string. */
  shortcut?: undefined | string | readonly (string)[];
  /** Icon name resolved by the current QuireIconProvider. */
  icon?: string | undefined;
  /** Current value of a radio group; its children describe the options. */
  selectedValue?: string | undefined;
  /** Whether activating a leaf closes the menu; checkboxes and radio items default to false. */
  closeOnSelect?: boolean | undefined;
  /** Checked state for a toggle row; omission is an ordinary action. */
  checked?: boolean | undefined;
  /** Visual action emphasis. */
  tone?: undefined | "neutral" | "danger";
};
```

### QuireCommandList

#### Props

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| label | 是 | — | Accessible name for the complete command menu. |
| items | 是 | — | Ordered feature-owned command declarations. |
| surfaceClass | 否 | undefined | Optional feature class applied to the public menu surface. |
| focusOwner | 否 | — | Keep native focus on this input/editor; rows use virtual highlighting and aria-activedescendant. Forward owned keys through handleKeydown. |

**label**

```ts
string
```

**items**

```ts
readonly QuireKitCommandListItem[]
```

```ts
readonly ({
  /** Stable feature-owned identity emitted on activation. */
  key: string;
  /** Localized visible and accessible row label. */
  label: string;
  /** 相邻的相同分组只显示一次标题；不加入键盘停靠点。 */
  group?: undefined | string;
  /** 命令的简短辅助说明，不进入主标签或键盘查找。 */
  description?: string | undefined;
  /** Whether the command is currently unavailable. */
  disabled?: boolean | undefined;
  /** Optional radio state; omission renders an ordinary menu item. */
  checked?: boolean | undefined;
  /** Whether a semantic divider precedes this command. */
  separatorBefore?: boolean | undefined;
})[]
```

**surfaceClass**

```ts
string | undefined
```

```ts
undefined | string
```

**focusOwner**

```ts
HTMLElement | null | undefined
```

```ts
undefined | null | HTMLElement
```

#### Events

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| select | 否 | — |  |

**select**

```ts
[key: string]
```

#### Slots

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| leading | 否 | — | Optional leading icon or state mark. |
| trailing | 否 | — | Optional trailing shortcut or disclosure mark. |

**leading**

```ts
QuireKitCommandListItemSlotProps
```

```ts
{
  /** Current stable command declaration. */
  item: {
    /** Stable feature-owned identity emitted on activation. */
    key: string;
    /** Localized visible and accessible row label. */
    label: string;
    /** 相邻的相同分组只显示一次标题；不加入键盘停靠点。 */
    group?: undefined | string;
    /** 命令的简短辅助说明，不进入主标签或键盘查找。 */
    description?: string | undefined;
    /** Whether the command is currently unavailable. */
    disabled?: boolean | undefined;
    /** Optional radio state; omission renders an ordinary menu item. */
    checked?: boolean | undefined;
    /** Whether a semantic divider precedes this command. */
    separatorBefore?: boolean | undefined;
  };
  /** Zero-based position in the ordered menu. */
  index: number;
}
```

**trailing**

```ts
QuireKitCommandListItemSlotProps
```

```ts
{
  /** Current stable command declaration. */
  item: {
    /** Stable feature-owned identity emitted on activation. */
    key: string;
    /** Localized visible and accessible row label. */
    label: string;
    /** 相邻的相同分组只显示一次标题；不加入键盘停靠点。 */
    group?: undefined | string;
    /** 命令的简短辅助说明，不进入主标签或键盘查找。 */
    description?: string | undefined;
    /** Whether the command is currently unavailable. */
    disabled?: boolean | undefined;
    /** Optional radio state; omission renders an ordinary menu item. */
    checked?: boolean | undefined;
    /** Whether a semantic divider precedes this command. */
    separatorBefore?: boolean | undefined;
  };
  /** Zero-based position in the ordered menu. */
  index: number;
}
```

#### 公开实例成员

| 名称 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- |
| handleKeydown | 否 | — |  |

**handleKeydown**

```ts
(event: KeyboardEvent) => boolean
```

```ts
{ (event: KeyboardEvent): boolean; }
```

#### 相关类型

```ts
type QuireKitCommandListItem = {
  /** Stable feature-owned identity emitted on activation. */
  key: string;
  /** Localized visible and accessible row label. */
  label: string;
  /** 相邻的相同分组只显示一次标题；不加入键盘停靠点。 */
  group?: undefined | string;
  /** 命令的简短辅助说明，不进入主标签或键盘查找。 */
  description?: string | undefined;
  /** Whether the command is currently unavailable. */
  disabled?: boolean | undefined;
  /** Optional radio state; omission renders an ordinary menu item. */
  checked?: boolean | undefined;
  /** Whether a semantic divider precedes this command. */
  separatorBefore?: boolean | undefined;
};
```

```ts
type QuireKitCommandListItemSlotProps = {
  /** Current stable command declaration. */
  item: {
    /** Stable feature-owned identity emitted on activation. */
    key: string;
    /** Localized visible and accessible row label. */
    label: string;
    /** 相邻的相同分组只显示一次标题；不加入键盘停靠点。 */
    group?: string | undefined;
    /** 命令的简短辅助说明，不进入主标签或键盘查找。 */
    description?: string | undefined;
    /** Whether the command is currently unavailable. */
    disabled?: boolean | undefined;
    /** Optional radio state; omission renders an ordinary menu item. */
    checked?: boolean | undefined;
    /** Whether a semantic divider precedes this command. */
    separatorBefore?: boolean | undefined;
  };
  /** Zero-based position in the ordered menu. */
  index: number;
};
```

### QuireMenuSeparator

#### Props

无。

#### Events

无。

#### Slots

无。

#### 公开实例成员

无。
