<view class="liftarray">
<showcardpop id="liftpop" class="cardpop"></showcardpop>
<view class="liftcardbox">
<view class="liftcard"><image id="Moon" bindtap="ShowCardPop" class="liftcardimg" src="{{Url_image_moon}}"></image></view>
<view class="liftcard"><image id="Mercury" bindtap="ShowCardPop" class="liftcardimg" src="{{Url_image_mercury}}"></image></view>
<view class="liftcard"><image id="Venus" bindtap="ShowCardPop" class="liftcardimg" src="{{Url_image_venus}}"></image></view>
</view>
</view>
点击图片触发自定义的弹窗组件,但是在运行后发现第一次点击成功触发,关闭弹窗后无法再次触发
ShowCardPop:function (e){
//console.log(e.currentTarget.id)
this.ShowCardPop = this.selectComponent("#liftpop")
this.ShowCardPop.setPop(e.currentTarget.id+":"+this.data.MyArray[e.currentTarget.id],"xxx")
this.ShowCardPop.showPopup()
},
报错为: Component "pages/home/home" does not have a method "ShowCardPop" to handle event "tap".
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
这样就没问题了
this.selectComponent("#liftpop").setPop(e.currentTarget.id+":"+this.data.MyArray[e.currentTarget.id],"xxx")