'triggerEvent' of undefined ? 不执行

发布于 7 年前作者 daiping7978 次浏览最后编辑 7 年前来自 ask
使用自定义<Child>组件
<parent>
  <Child isShow="{{isShow}}" bind:myEvent="onMyEnvent></Child>
</parent>

在<Child>中
  <view><button bindtap="handleDelete"/></view>

methods:{
  handleDelete(){
  let that=this
    wx.showToast({
   title'操作成功',
   success:function(){
     console.log('11111111111111111', )
     that.triggerEvent('myevent',{isShow:false}) // Cannot read property 'triggerEvent' of undefined
          // 或者不执行
    }
   })
  }
}
1 回复
xiapan
xiapan1 楼5 年前