父组件:
<tpupload bind:tpuploadFun="tpupload1" imgs="{{imgs}}" tpNum=‘9‘ ></tpupload>
// 事件可以拿到传来的参数
tpupload1(e){ console.log(e.detail.imgs, ‘这个是子组件传递来的数据‘)
},
子组件:触发父组件事件,并传参
that.triggerEvent(‘tpuploadFun‘,{ imgs:imgs })
2023-09-26 21:40:28
父组件:
<tpupload bind:tpuploadFun="tpupload1" imgs="{{imgs}}" tpNum=‘9‘ ></tpupload>
// 事件可以拿到传来的参数
tpupload1(e){ console.log(e.detail.imgs, ‘这个是子组件传递来的数据‘)
},
子组件:触发父组件事件,并传参
that.triggerEvent(‘tpuploadFun‘,{ imgs:imgs })
下一篇:uni-app中小程序地图选点