设置display flex时,bindtap事件无法传参数
发布于 6 年前 作者 yuli 10783 次浏览 来自 问答

给样式设置了display:flex 相关的属性,通过bindtap事件获取data-xx参数时,发现都为空。去掉 display:flex ,后正常,是否有相关解决方法?

3 回复

样式内容:

.dis-flex {

display: -webkit-flex;

display: flex;

}

.flex-around {

flex-wrap: wrap;

justify-content: space-around;

align-items: center;

}

遍历的列表内容格式:

orderList: [{

icon: /asset/images/icon_usercenter_wait_for_pay.png,

name: 待付款,

path: waitForPay,

}]

会出现概率性的情况,不懂是哪里出错了,在currentTarget里面有数据

十有八九你用的target,然而你需要用currentTarget

测试没有复现,有代码片段吗?

回到顶部