Svelte – svelte-element

0 min read


ElementComp.svelte

<script>
	const options = ['h1', 'h3', 'p'];
	let selected = options[0];
</script>

<div style="display: position: relative;">
<select bind:value={selected}>
	{#each options as option}
		<option value={option}>{option}</option>
	{/each}
</select>

<svelte this={selected}>I'm a {selected} tag</svelte>
</div>

App.svelte

	<FolderComp />
	<ColorComp />
	<ElementComp />

dan hasilnya akan seperti ini …

Okay berhasil.. source github ada disini .. cyaaa…

Bima Sena

Leave a Reply

Your email address will not be published. Required fields are marked *