本页还没有译文
本页 14 段还没译成Tiếng Việt,下面显示的是英文原文。hotkeySequence
还没翻译译自英文(tanstack.com)本页 14 段都还没译
function hotkeySequence(sequence, options?): <T>(proto, methodName, descriptor) => void;Defined in: decorators/hotkey-sequence.ts:30
Decorator that registers a keyboard sequence (e.g. Vim-style) on the element when it connects and unregisters when it disconnects. Uses HotkeySequenceController under the hood.
Parameters
sequence
HotkeySequence
The key sequence to listen for (e.g. ['G', 'G'] for "g g").
options?
SequenceOptions = HOTKEY_SEQUENCE_DEFAULT_OPTIONS
Optional sequence options (target, timeout, enabled, etc.).
Returns
A method decorator for use on LitElement methods.
<T>(proto, methodName, descriptor) => void
Example
class MyElement extends LitElement {
@hotkeySequence(['G', 'G'])
goToTop() { window.scrollTo(0, 0) }
@hotkeySequence(['D', 'D'], { timeout: 500 })
deleteLine() { this.deleteCurrentLine() }
}AI 翻译查看英文原文