本页还没有译文
本页 13 段还没译成Русский,下面显示的是英文原文。createHotkeySequenceAttachment
还没翻译译自英文(tanstack.com)本页 13 段都还没译
function createHotkeySequenceAttachment(
sequence,
callback,
options?): Attachment<HTMLElement>;Defined in: packages/svelte-hotkeys/src/createHotkeySequence.svelte.ts:151
Create an attachment for element-scoped keyboard sequences.
Parameters
sequence
MaybeGetter<HotkeySequence>
callback
HotkeyCallback
options?
MaybeGetter<CreateHotkeySequenceOptions> = {}
Returns
Attachment<HTMLElement>
Example
<script lang="ts">
import { createHotkeySequenceAttachment } from '@tanstack/svelte-hotkeys'
const vimKeys = createHotkeySequenceAttachment(['G', 'G'], () => {
scrollToTop()
})
</script>
<div tabindex="0" {@attach vimKeys}>
Focus here and press g then g
</div>
AI 翻译查看英文原文