微信小程序 数据绑定

1.需要进行循环的标签

<view class="listn" wx:for="{{resData}}" wx:key='index'>
2.页面js中
  onLoad: function (options) {

    wx.request({
      url: 'https:     ',
      data: {
        x: '',
        y: ''
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success:res=> {
        this.setData({
          resData:res.data
        })
      }
    })

  },
原文地址:https://www.cnblogs.com/xyangs/p/13578732.html