1<ul id="example-2">
2 <li v-for="(item, index) in items">
3 {{ parentMessage }} - {{ index }} - {{ item.message }}
4 </li>
5</ul>
1<!-- To gain access to the array index: -->
2<ul>
3 <li v-for="(game, index) in games"></li>
4</ul>
5<!--
6 You only want the index in specific cases. Use `:key` as
7 standard. See the other greps.
8-->
1<ul id="v-for-object" class="demo">
2 <li v-for="value in object">
3 {{ value }}
4 </li>
5</ul>
1var example2 = new Vue({
2 el: '#example-2',
3 data: {
4 parentMessage: 'Parent',
5 items: [
6 { message: 'Foo' },
7 { message: 'Bar' }
8 ]
9 }
10})