svelte-if-preprocessor

Svelte If Preprocessor

Svelte preprocessor

This preprocessor changes if props to svelte's if tag

changes below code

<button if={2 + 2 === 4}>
  Show
</button>

to:

{#if 2 + 2 === 4}
<button>
  Show
</button>
{/if}

TODO: use prettier

https://gist.github.com/mizchi/d9be0ec969203f32f66e5f6eda9decb9

Top categories

Loading Svelte Themes