Svelte – Shorthand Directive

0 min read


Hello ladies and gentlemen … welcome back to Svelte Channel.. hahah

ShortHand.svelte

<script>
	let big = false;
</script>

<label>
	<input type=checkbox bind:checked={big}>
	big
</label>

<div class:big>
	some {big ? 'big' : 'small'} text
</div>

<style>
	.big {
		font-size: 4em;
	}
</style>

dan import ke App.svelte

	<ClassDirective />
	<ShortHand />

</main>

hasilnya…

okay mantab sudah bisa ya… saya sudahi dulu saja ya teman2,,, link githubnya disini … cyaaa…

Bima Sena

Leave a Reply

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