iter: d25 menu 条目支持快捷键提示

This commit is contained in:
ui-arch-bot
2026-10-23 17:06:17 +08:00
parent 6efe3ab57b
commit 6a5e6623fe
9 changed files with 42 additions and 11 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ export function menu(props: MenuProps): HTMLElement {
disabled: item.disabled ? true : undefined,
onClick: () => pick(item),
},
item.label,
h('span', { class: 'ua-menu-label' }, item.label),
item.shortcut ? h('kbd', { class: 'ua-menu-key' }, item.shortcut) : null, // 快捷键只做提示,不拦截按键
) as HTMLButtonElement;
if (!item.disabled) focusables.push(btn); // 禁用项不参与导航
return btn;