本页还没有译文
本页 43 段还没译成Español,下面显示的是英文原文。HotkeySequenceController
还没翻译译自英文(tanstack.com)本页 43 段都还没译
Defined in: controllers/hotkey-sequence.ts:26
A Lit ReactiveController that registers a keyboard sequence (e.g. Vim-style) when the host element is connected and unregisters it when the host is disconnected.
Example
class MyElement extends LitElement {
private seq = new HotkeySequenceController(this, ['G', 'G'], () => this.goToTop())
constructor() {
super()
this.addController(this.seq)
}
}Implements
ReactiveController
Constructors
Constructor
new HotkeySequenceController(
_host,
_sequence,
callback,
_options?): HotkeySequenceController;Defined in: controllers/hotkey-sequence.ts:37
Parameters
_host
ReactiveControllerHost
The Lit component that owns this controller. Add the controller with addController().
_sequence
HotkeySequence
The sequence to register.
callback
HotkeyCallback
Called with the host as this.
_options?
SequenceOptions | (() => SequenceOptions)
Options or a getter. Property getters are read on connection and after host updates.
Returns
HotkeySequenceController
Methods
hostConnected()
hostConnected(): void;Defined in: controllers/hotkey-sequence.ts:49
Registers when connected and a target is available.
Returns
void
Implementation of
ReactiveController.hostConnectedhostDisconnected()
hostDisconnected(): void;Defined in: controllers/hotkey-sequence.ts:68
Releases registrations when the host disconnects.
Returns
void
Implementation of
ReactiveController.hostDisconnectedhostUpdated()
hostUpdated(): void;Defined in: controllers/hotkey-sequence.ts:55
Refreshes options after rendering, when scoped targets are available.
Returns
void
Implementation of
ReactiveController.hostUpdated