Skip to content

Commit

Permalink
docs: add <svelte:document> example (#8387)
Browse files Browse the repository at this point in the history
oekazuma authored Mar 16, 2023
1 parent 952f8c5 commit a45afd5
Showing 6 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script>
let selection = '';
const handleSelectionChange = (e) => selection = document.getSelection();
</script>

<svelte:document on:selectionchange={handleSelectionChange} />

<p>Select this text to fire events</p>
<p>Selection: {selection}</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "<svelte:document>"
}

0 comments on commit a45afd5

Please sign in to comment.