遍历数组
characters:["aaaaaa","bbbbbbb","cccccccccc"]
<li v-for=" character in characters">
character
</li>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
遍历对象
users:[
{name:"aaaaaaa",age:"10"},
{name:"bbbbbb",age:"20"},
{name:"ccccc",age:"30"},
]
<li v-for="(user,incex) in users" >
{{index+1}}. {{user.name}} --{{user.age}}
</li>
+++++++++++++++++++++++++++
两层循环
<template v-for="(user,index) in users" >
<div v-for="(val, key) in user"></div>
</template>
网友评论