[Vuejs]-Is there a way to use Conditional Rendering within List Rendering (v-for) in Vue JS

1👍

Based on your question, if you want to keep three <li> items then simply you can check if respective tags exist or not as below:

<ul class="book-tags>
  <li v-if="book.tagOne">{{book.tagOne}}</li>
  <li v-if="book.tagTwo">{{book.tagTwo}}</li>
  <li v-if="book.tagThree">{{book.tagThree}}</li>
</ul>

Leave a comment