学无先后,达者为师

网站首页 编程语言 正文

UNI-APP中点击事件多重响应问题的解决,list列表项item和列表项item中按钮的点击事件冲突,重叠

作者:沧海龙腾LV 更新时间: 2024-02-29 编程语言

问题描述:

list列表项item和列表项item中按钮的点击事件冲突

点击list列表项item执行列表项item点击事件

点击列表项item中按钮,先执行按钮的点击事件,然后继续执行列表项item点击事件(重复)

解决办法:

修改列表项item的click事件为 

<view class="list_item" @click="gotoDeviceDetailPage(index)">

修改列表项item中按钮的点击事件为

<view class="iconfont icon-collection_fill text_ye bottom_pr" @click.stop="cancelAttention(index)"></view>

完!!!

原文链接:https://ly9527.blog.csdn.net/article/details/115620446

  • 上一篇:没有了
  • 下一篇:没有了
栏目分类
最近更新