数组:数值
<ul id="example-1">
<li v-for="item in items">
{{ item.message }}
</li>
</ul>
数组:数值加索引
<ul>
<template v-for="(item,index) of items">
<li>{{ item.msg }}</li>
<li>{{index}}</li>
</template>
</ul>
字典:key value index
<ul id="repeat">
<li v-for="(value,key,index) in object">
{{ value }} {{key}} {{index}}
</li>
</ul>
new Vue({
el: '#repeat',
data: {
object: {
FirstName: 'John',
LastName: 'Doe',
Age: 30
}
}
})
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)