微信小程序开发小结
时间:2019-01-22 13:16:39
收藏:0
阅读:214
1、点击按钮分享功能:
使用Button组件,设置open-type="share",然后在js文件的onShareAppMessage方法中设置如下:
onShareAppMessage: function (options) { let shareObj = {} if (options.from == "button") { //设置title、path、imageUrl shareObj.title = ‘‘ shareObj.path = ‘‘ shareObj.imageUrl = ‘‘ } return shareObj }
2、Navigator组件中的子元素也绑定了事件,点击子元素触发时,页面会跳转。
解决:子元素绑定事件时不要用bindtap,改用catchtap
评论(0)