原文连接   ---  https://blog.csdn.net/qq_40190624/article/details/87972265

 

 

组件 js: 

var value = 123;this.triggerEvent('callSomeFun', value)

 

父组件 wxml:

component bind:callSomeFun="onLoad"/component

 

父组件 js :

onLoad: function() {  ... ...  }

 

 

 

[注] : 这里调用的时父组件的 onLoad 生命周期函数, 也可以调用其他自定义方法。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

TAG标签: 微信小程序父组件调用子组件方法

http://www.xiaochengxub.com/read-102794.html