微信小程序-从组件触发页面任务

时间:2020-04-10 11:54:49   收藏:0   阅读:129

组件:第一个参数传入出发方法的名字,第二个参数传入需要传入的参数

this.triggerEvent(‘timeUpdate‘,{
              currentTime
            })

 

页面:bind:xxx,   xxx为传入的方法  也可以直接bindxxx

 <l-progress-bar bindtimeUpdate="timeUpdate" bindmusicEnd="next" />

 

页面.js

timeUpdate(event){
    console.log(event.detail)
  },

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!