Skip to content

Support for x in y with else #60

@aalin

Description

@aalin

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions