framework icon indicating copy to clipboard operation
framework copied to clipboard

Support `for x in y` with `else`

Open aalin opened this issue 3 years ago • 0 comments

From the Svelte docs:

An each block can also have an {:else} clause, which is rendered if the list is empty.

{#each todos as todo}
	<p>{todo.text}</p>
{:else}
	<p>No tasks today!</p>
{/each}

Would be nice to have the same thing in Mayu.

= for todo in todos
  %p= todo.text
= else
  %p No tasks today!

aalin avatar Feb 09 '23 19:02 aalin