Subscribe on changes!

v-for add v-else

avatar
Dec 1st 2022

What problem does this feature solve?

Want to add v-else corresponding to v-for render the contents of v-for when the length of the object traversed by v-else is empty

What does the proposed API look like?

like svelte:

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

to vue

<p v-for="todo in todos">{todo.text}</p>
<p v-else>No tasks today!</p>