小程序-page给组件传递事件( page调用组件中的方法 )

 1 //子组件中
 2 Component({
 3     methods:{
 4         addInterval:function(){
 5             .....
 6         }    
 7     }
 8 })
 9 //page中
10 //在wxml中引用组件时候,给组件得到属性加上 id=mycircle
11 //在js中,可以传递调用事件
12 this.selectComponent("#mycircle).addInterval();

this.selectComponent("#mycircle).addInterval();

posted @ 2021-01-06 08:58  惟愿安好ly  阅读(862)  评论(0)    收藏  举报