zoukankan      html  css  js  c++  java
  • 【小程序】小程序的循环遍历

    js文件中数据:

    data:{
        imgUrls:[
          '../../images/slide/banner1.jpg'
        ],
        contentItems:[
          "../../images/index/01.jpg",
          "../../images/index/02.jpg"
        ],
        aa:[
          {
            id: 1,txt: "ss", src : "../../images/index/01.jpg"
          },
          {
            id: 2,txt: "ssxx", src: "../../images/index/02.jpg"
          }
        ]
    
    }
    

    wxml 中读取数据:

    <view class='content'>
        <view class='content-item' wx:for="{{aa}}" id='{{index}}' bindtap=''>
        <image src='{{item.src}}'></image>
        <view class='content-item-text'>
        <text>{{item.txt}}</text>
        </view>
        </view>
    </view>
    
  • 相关阅读:
    uIP的ARP协议分析
    如何使函数不生成执行代码
    计算机网络基础
    [Hive
    [Hive
    [Hive
    [Hive
    [Hive
    [Hive
    [Hive
  • 原文地址:https://www.cnblogs.com/inc904/p/10110417.html
Copyright © 2011-2022 走看看