A case study of WeChat applet implementing foreground loop data binding

黄舟
Release: 2017-09-12 09:36:04
Original
2601 people have browsed it

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>
Copy after login

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"
  }]
},
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template