1<ul id="example-1">
2 <li v-for="item in items" :key="item.message">
3 {{ item.message }}
4 </li>
5</ul>
1// object: {
2// title: 'How to do lists in Vue',
3// author: 'Jane Doe',
4// publishedAt: '2016-04-10'
5// }
6<div v-for="(value, name, index) in object">
7 {{ index }}. {{ name }}: {{ value }}
8</div>
1<div v-for="(value, name, index) in object">
2 {{ index }}. {{ name }}: {{ value }}
3</div>
1new Vue({
2 el: '#v-for-object',
3 data: {
4 object: {
5 title: 'How to do lists in Vue',
6 author: 'Jane Doe',
7 publishedAt: '2016-04-10'
8 }
9 }
10})
1<ul id="v-for-object" class="demo">
2 <li v-for="value in object">
3 {{ value }}
4 </li>
5</ul>