Sometimes we don't really want a html element,for example in angular, we do loop like below,we don't want additional tag between ul and li,ng-cotainer solved the problem,is there any solution in Vue?
<ul class="book-list">
<ng-container *ngFor="let book of books">
<li class="book-item">{{ book.title }}</li>
<li class="book-item">{{ book.author }}</li>
<li class="book-item">{{ book.price }}</li>
</ng-container>
</ul>
Just like angular solution
Read the docs: https://vuejs.org/v2/guide/list.html#v-for-on-a-lt-template-gt
For everyone finding this answer, the Vue alternative for <ng-container>
is <template>
.
Most helpful comment
Read the docs: https://vuejs.org/v2/guide/list.html#v-for-on-a-lt-template-gt