小程序-for指令

wxml

<text>商品列表</text>
<view>
  <view wx:for="{{dataList}}">{{index}}-{{item}}</view>
  <view wx:for="{{dataList}}" wx:for-index="idx" wx:for-item="x">{{idx}}-{{x}}</view>
</view>
<view>
  <view wx:for="{{userInfo">{{index}}-{{item}}</view>
</view>

js

data: {
    "dataList":["白洁","惠清","淑婷"],
    "userInfo":{
      name:"alex",
      age:18
    }
   
  },

 

posted @ 2020-05-11 13:24  南啾  阅读(175)  评论(0编辑  收藏  举报