zoukankan      html  css  js  c++  java
  • 微信小程序for循环中传递动态参数

    for循环中的参数,没法传到对应的 js里,所以直接在 wxml页面上跳转

    发送参数的 wxml页面

    <view class="uploader" wx:for="{{bookList}}" wx:for-item = "item">
      <navigator url="../catalog/catalog?id={{item.id}}&title={{item.title}}" open-type="navigate" class="uploader-text">
        <text>{{item.title}}</text>
      </navigator>
    </view>

    接收参数的 js文件

    Page({
      data: {title:''},
      onLoad: function (options) {
          this.setData({
            title: options.title
        })
      }
    })

    原创文章,欢迎转载,转载请注明出处!

  • 相关阅读:
    软件工程评分表
    评论
    团队成员介绍
    第九天冲刺
    第八天冲刺
    第七天冲刺
    第六天冲刺
    第五天冲刺
    第四天冲刺
    第三天冲刺
  • 原文地址:https://www.cnblogs.com/acm-bingzi/p/wechat_param.html
Copyright © 2011-2022 走看看