1<ul id="example-1">
2 <li v-for="item in items" :key="item.message">
3 {{ item.message }}
4 </li>
5</ul>
1<ul id="v-for-object" class="demo">
2 <li v-for="value in object">
3 {{ value }}
4 </li>
5</ul>
1<div class="list">
2 <div class="list-item" v-for="item in fruitsNameList">
3 {{item}}
4 </div>
5</div>
1var example2 = new Vue({
2 el: '#example-2',
3 data: {
4 parentMessage: 'Parent',
5 items: [
6 { message: 'Foo' },
7 { message: 'Bar' }
8 ]
9 }
10})
1<option v-for="(location, index) in locations" v-bind:value="location.id" v-bind:selected="index === 0">
2 {{ location.from }} - {{ location.to }}
3</option>