Skip to main content

<svelte:document>

<svelte:document onevent={handler} />
<svelte:document bind:prop={value} />

Similarly to <svelte:window>, this element allows you to add listeners to events on document, such as visibilitychange, which don't fire on window. It also lets you use attachments on document.

<svelte:window> と同様に、この要素はコンポーネントのトップレベルにのみ配置でき、ブロックや他の要素の中に含めることはできません。

<svelte:document onvisibilitychange={handleVisibilityChange} {@attach someAttachment} />

以下のプロパティにもバインドできます:

  • activeElement
  • fullscreenElement
  • pointerLockElement
  • visibilityState

すべて読取専用です。

Edit this page on GitHub llms.txt