<svelte:document>
<svelte:document onevent={handler} /><svelte:document bind:prop={value} />与<svelte:window>类似,此元素允许您向document上的事件添加监听器,例如visibilitychange,这些事件在window上不会触发。它还允许您在document上使用actions。
与<svelte:window>一样,此元素只能出现在组件的最顶层,绝不能在块或元素内部。
<svelte:document onvisibilitychange={handleVisibilityChange} use:someAction />您也可以绑定以下属性:
activeElementfullscreenElementpointerLockElement可见状态
所有都是只读的。
Edit this page on GitHub llms.txt
previous next