建筑招工人在哪个网站比较好找,网站备案点不进去,wordpress表白,网站建设公司 技术评估问题#xff1a;在使用此插件时发现#xff0c;列表内容前几行还是能正常点击的#xff0c;但是从第二次出现的列表开始就没有点击事件了 原因#xff1a;因为html元素是复制出来的#xff08;滚动组件是将后面的复制出来一份#xff0c;进行填铺页面#xff0c;方便滚动… 问题在使用此插件时发现列表内容前几行还是能正常点击的但是从第二次出现的列表开始就没有点击事件了 原因因为html元素是复制出来的滚动组件是将后面的复制出来一份进行填铺页面方便滚动 解决往滚动组件的父节点上添加绑定事件js冒泡机制通过e.target定位到具体点击位置然后判断点击位置是否是你滚动组件的一列/行 具体实现 div classboxContent-public-main clickchooseCompanyvue-seamless-scrollclasswarpv-ifcompanyList.length 0:datacompanyList:class-optionclassOptiondiv classwarp-itemdivclasswarp-item-liv-for(item, index) in companyList:keyitem.id:chooseIndexindex // 自定义参数为了方便能获取到点击的哪一项也可以使用JSON.stringify(item);div classwarp-item-leftspan classwarp-item-left-title{{ item.name }}/spanem class{{ item.address }}/em/divdiv classwarp-item-right v-htmlitem.intro/div/div/div/vue-seamless-scrolldiv v-else classnone暂无公司数据.../div/divchooseCompany(e: any) {const child: any e.target.closest(.warp-item-li); // 获取点击的那一项let index: any child.getAttribute(chooseIndex); // 获取那一项自定义的 chooseIndex参数if (index) {// 逻辑代码...(this.$parent as any).showCompanyDialog(this.companyList[index]);}}