index界面
index.wxml
![](https://img-blog.csdnimg.cn/img_convert/5dafb6d7f0c16686be74aad3657bf357.png)
index.json
![](https://img-blog.csdnimg.cn/img_convert/da7b2bad36520389385c081100d5c937.png)
index.js
![](https://img-blog.csdnimg.cn/img_convert/341b0de996232b45714effe18a451fc4.png)
子组件页面
![](https://img-blog.csdnimg.cn/img_convert/3c2632704dc7bfd031a0fcb9715a6582.png)
![](https://img-blog.csdnimg.cn/img_convert/0a1ddbd9fdeafd92fcfcfb5956300374.png)
首先父组件引用组件定义一个简单的点击事件,bind:test="dianji" 再在 index.js log一下
其次子组件传值是
handchild() {
this.triggerEvent('test'(父组件定义的bind),this.data.songlist(这个是子组件的值))
},
index界面
index.wxml
index.json
index.js
子组件页面
首先父组件引用组件定义一个简单的点击事件,bind:test="dianji" 再在 index.js log一下
其次子组件传值是
handchild() {
this.triggerEvent('test'(父组件定义的bind),this.data.songlist(这个是子组件的值))
},