vue props 传递function
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利
parent.vue
<children @customfn="fn"></children>
children.vue
this.customfn() // 报错customfn 未定义
解决方法
parent.vue
<children :customfn="fn"></children>
children.vue
this.customfn()