mayu-live / framework

Mayu is a live updating server-side component-based VDOM rendering framework written in Ruby
https://mayu.live
GNU Affero General Public License v3.0
130 stars 4 forks source link

Support `for x in y` with `else` #60

Open aalin opened 1 year ago

aalin commented 1 year ago

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!