本页还没有译文
本页 14 段还没译成Français,下面显示的是英文原文。hotkey
还没翻译译自英文(tanstack.com)本页 14 段都还没译
function hotkey(hotkey, options?): <T>(proto, propertyKey, descriptor?) => void;Defined in: decorators/hotkey.ts:29
Decorator that registers a keyboard hotkey on the element when it connects and unregisters when it disconnects. Uses HotkeyController under the hood.
Parameters
hotkey
RegisterableHotkey
The key or key combo to listen for (e.g. 'Mod+S' or a raw hotkey object).
options?
HotkeyOptions = HOTKEY_DEFAULT_OPTIONS
Optional registration options (target, platform, enabled, etc.).
Returns
A method decorator for use on LitElement methods.
<T>(proto, propertyKey, descriptor?) => void
Example
class MyElement extends LitElement {
@hotkey('Mod+S')
save() { this.doSave() }
@hotkey('Escape')
close() { this.dismiss() }
}AI 翻译查看英文原文