手机版

微信小程序如何获取wx:for列表中点击行的信息

时间:2021-12-01 来源:互联网 编辑:宝哥软件园 浏览:

1.如果想要获取点击行的索引(即为循环数组的索引)

view class=' choose title ' view class=' choose ' wx : for=' { { monArray } } ' wx : for-index=' bindex ' wx : key=' item。id ' view class=' item name ' bind tap=' switch tab ' data-bindex=' { { bindex } } ' data-id=' { { item。id } } ' { { item } }/view/view/view js代码

switchTab:函数{控制台。log(e)var index=parsent(e . CurrentTarget。数据集。索引)} 点击结果

2.如果想要获取点击行的更详细信息

view class=' weui-cells search bar-result ' wx : if=' { { InputVal。长度{ 0 } } '隐藏=' { {!resultshowd } } '视图wx : for=' { { uplink } } ' wx : for-item=' item ' wx : key=' item。id ' navigator URL=' class=' weui-cell ' hover-class=' weui-cell _ active ' data-item=' { { item } } ' data-id=' item。id ' bind tap=' querybtnchink ' view class=' weui-cell _ BD ' view { { uplink[index]} .name } } : { { uplink[index]} .文本} }-{ {下行[索引]。文本} }/视图/视图/导航器/视图/视图/视图射流研究…

查询电话:函数(e) { console.log('click ',e)var click item=e . CurrentTarget。数据集。项目}

版权声明:微信小程序如何获取wx:for列表中点击行的信息是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。