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