1.wxml添加标题open-type设为‘share’

buttonopen-type="share"/button

2.点击就会触发下边的事件了

//jsonShareAppMessage:function(){//console.log('aaa');letthat=this;return{title:请填写分享标题,//转发后所显示的titlepath:'请填写你要打开的路径',//相对的路径success:(res)={//成功后要做的事情//console.logwx.getShareInfo({shareTicket:res.shareTickets[0],success:(res)={that.setData({isShow:true})},fail:function(res){console.log(res)},complete:function(res){console.log(res)}})},fail:function(res){//分享失败console.log(res)}}},

TAG标签: 微信小程序小程序无法分享小程序分享

http://www.xiaochengxub.com/read-98205.html