vue的v-for数组和对象

v-for="(item,index) of hot"    //数组遍历

v-for="(item,key,index) of cities"   //对象遍历
//key 是对象的属性 item对应的属性值

 key值

 <div class="area" v-for="(item,key) of cities" :key="key">
<div class="title border-topbottom">{{key}}</div>
<div class="item-list">
<div class="item border-bottom" v-for="city of item " :key="city.id">{{city.name}}</div>
</div>
</div>

  

上一篇:js数据结构之二叉树的详细实现方法


下一篇:Linux下停Tomcat服务器,出现Connection refused错误解决办法