[docs] add `<svelte:element>` example (#7439)

pull/6583/head
Kazuma Oe 2 years ago committed by GitHub
parent 467ba0a920
commit 707455fa8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,12 @@
<script>
const options = ['h1', 'h3', 'p'];
let selected = options[0];
</script>
<select bind:value={selected}>
{#each options as option}
<option value={option}>{option}</option>
{/each}
</select>
<svelte:element this={selected}>I'm a {selected} tag</svelte:element>
Loading…
Cancel
Save