Skip to content

Commit 707455f

Browse files
authored
[docs] add <svelte:element> example (#7439)
1 parent 467ba0a commit 707455f

File tree

10 files changed

+15
-0
lines changed

10 files changed

+15
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script>
2+
const options = ['h1', 'h3', 'p'];
3+
let selected = options[0];
4+
</script>
5+
6+
<select bind:value={selected}>
7+
{#each options as option}
8+
<option value={option}>{option}</option>
9+
{/each}
10+
</select>
11+
12+
<svelte:element this={selected}>I'm a {selected} tag</svelte:element>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"title": "<svelte:element>"
3+
}

0 commit comments

Comments
 (0)