[Vuejs]-Can I use v-if and v-for outside HTML tag?

0👍

Basically, yes, you could use it inside v-if inside one list element and v-else inside another:

<ul>
 <li v-if="flag">
  <myVueComponent                            
   v-bind:list="LIST">
  </myVueComponent>
 </li>
 <li v-else v-for="item in LIST">
  <a :href="url+item.name">@{{item.name}}</a>
 </li>
</ul>

Leave a comment