赞
踩
类似
Vue
中this.$emit()
,子组件可执行父组件的函数方法。
在小程序里,组件间通信与传统 Vue
有所区别。
官方文档:https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/events.html
其实官方文档已介绍 this.triggerEvent
与其参数,下面是更加易于理解的例子。
子组件(help):
<view bindtap="onTap"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。