Skip to content

wx:for的使用

数据

json
data: {
    course:"????",
    list:[{
      id:1,
      name:"zly"
    },
    {
      id:2,
      name:"zly"
    }]
  },
html
wx:for"{{[数组]}}"
index 索引
item 数据
<view wx:for="{{list}}">
<view style="color: aqua;">{{index}}{{item.id}}{{item.name}}</view>
<view>hello</view>
</view>