[Vuejs]-How to conditionally display message if there are no v-for items?

4👍

Exactly like in your example, but add length checking:

<div v-if="events && events.length > 0">
      <div v-for="event in events"> etc etc </div>
</div>
<div v-else>Sorry there are no events</div>

Leave a comment