uniapp分享功能加传递参数


onShareAppMessage(res) {

  if (res.from === 'button') {// 来自页面内分享按钮
    console.log(res.target)
  }
  return {
    title: '分享的标题',
    path: '分享的路径'
  }

}


点击button按钮实现分享,同样需要onShareAppMessage

<button open-type="share" :data-type='{title}' :data-id='{shareid}'></button>

注:如果需要带参数,data-后面加你声明的,例:data-id,在onShareAppMessage里面的res.target里面能找到传递的参数


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM