November 2017
Beginner to intermediate
398 pages
8h 42m
English
We will now display the list of notes below the toolbar.
<aside class="side-bar">
<div class="toolbar">
<button @click="addNote"><i class="material-icons">add</i> Add note</button>
</div>
<div class="notes">
<!-- Note list here -->
</div>
</aside>
Now, we want to display a list of multiple div elements, one for each note. To achieve this, we need the v-for directive. It takes a special expression as the value, in the form of item of items, that will iterate over the items array or object and expose an item value for this part of the template. Here is an example:
<div v-for="item of items">{{ item.title }}</div>
You can also use the in keyword ...
Read now
Unlock full access