子组件:
<view class="grayMask" @tap="hideForm"></view>
父组件:
<myTestView @hideForm="hideApplyForm"></myTestView>
子组件回调:
hideForm:(e)=>{
that.$emit("hideForm",e);//hideForm是父组件的方法名,e是传过去的参数
}
父组件接收回调
hideApplyForm:(e)=>{
console.log(e);
}

微信扫码查看本文
发表评论