Skip to content

Instantly share code, notes, and snippets.

@lega911
Created July 5, 2021 15:42
Show Gist options
  • Save lega911/d6f930f4b47e7fed5335be83d692a423 to your computer and use it in GitHub Desktop.
Save lega911/d6f930f4b47e7fed5335be83d692a423 to your computer and use it in GitHub Desktop.
Insert block of JS
<script>
const styleDiv = el => {
el.style.border = '2px dotted red';
el.style.padding = '8px';
}
</script>
<div {* styleDiv($element) }>
{* $element.textContent = 'inserted text' }
</div>
{#each 5 as i}
{* const value = i**2 }
{i}**2 = {value}
<br/>
{/each}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment