Home > Article > WeChat Applet > A case study of WeChat applet implementing foreground loop data binding
This article mainly introduces the relevant information about the front-end loop data binding of the WeChat applet. Here are examples to help you learn and understand this part of the content. Friends in need can refer to it
WeChat applet Program front-end loop data binding
WeChat applet loop data binding to wxml example:
wxml:
<view wx:for="{{array}}"> {{item.message}} </view>
You can bind an array through the above wx.for. The array is of json type; the default index number is item, so use {{item.message}}
to display In data js:
data: { array: [ { "message": "foot", "txt": "123" }, { "message": "bar" }] },
The above json array can loop through the method in wxml to output the array data
The above is the detailed content of A case study of WeChat applet implementing foreground loop data binding. For more information, please follow other related articles on the PHP Chinese website!