orders是一个对象如下图所示
里面有个字段是_id,我想在点击view组件的时候把这个字段传回去,但是好像无法触发bindtap绑定的事件
我该怎么做才能达到上述目的呢?
请问这样进行数据绑定为啥不行呢?Why can't data binding be done in this way?
请问这样进行数据绑定为啥不行呢?orders是一个对象如下图所示
里面有个字段是_id,我想在点击view组件的时候把这个字段传回去,但是好像无法触发bindtap绑定的事件
我该怎么做才能达到上述目的呢?
Orders is an object, as shown in the figure below. There is a field in it_ ID, I want to pass this field back when I click the view component, but it seems that the bindtap binding event cannot be triggered. What can I do to achieve the above purpose?
回答:
打印orders看下,还有方法参数
wx:for要使用的必须是数组。如果是对象要这样写
<view data-order_id="{{orders._id}}"
原文出处:请问这样进行数据绑定为啥不行呢?
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。