wswdz
<!--下拉列表-->
<view class=\'lists\' bindtap="selectTap" wx:for="{{item}}" wx:key="key" wx:for-item="item" data-key=\'{{index}}\' >
     <view class=\'listsview\'>
         <text class=\'liststxt\'>{{item.name}}</text>
         <image class="downimg {{show && state==index &&\'select_img_rotate\'}}" src="{{item.img}}"></image>
     </view>
     <view class="{{show && state==index?\'actives\':\'defaults\'}} ">
         <text class=\'showtxt\'>{{item.nameshow}}</text>
      </view>
</view>
 
 
/**js**/
selectTap(e) {//展开 收缩
     console.log(e.currentTarget.dataset.key)  ////打印点击当前列表
     this.setData({
         show: !this.data.show,
         state: e.currentTarget.dataset.key ///当前点击的列表
     });
},

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-12-17
  • 2021-10-20
  • 2022-12-23
  • 2021-07-20
  • 2021-04-13
  • 2021-11-12
猜你喜欢
  • 2021-12-04
  • 2022-02-07
  • 2021-12-10
  • 2021-10-05
  • 2021-11-23
  • 2022-02-02
相关资源
相似解决方案