v-for
来遍历一个对象的 property
HTML:
<div v-for="(value, name) in object"> {{ name }}: {{ value }} </div>
Javascript:
new Vue({ el: '#v-for-object', data: { object: { title: 'How to do lists in Vue', author: 'Jane Doe', publishedAt: '2016-04-10' } } })
v-for
来遍历一个对象的 property
HTML:
<div v-for="(value, name) in object"> {{ name }}: {{ value }} </div>
Javascript:
new Vue({ el: '#v-for-object', data: { object: { title: 'How to do lists in Vue', author: 'Jane Doe', publishedAt: '2016-04-10' } } })