微信小程序按鈕去除邊框線,分享頁面


有一個需求是分享當前頁面,使用美工的分享按鈕圖片來分享,而小程序分享功能只有button有

open-type="share"這個屬性,使用image標簽肯定不行。我是這樣做的:
<button open-type="share"  
style="height:85rpx;width:215rpx;padding:0;background-color:#fff;border-color:#fff;margin-right:10rpx" >
<image style="height:85rpx;width:215rpx;"  src='../../../image/share_btn.png'></image>
</button>

加入css樣式去除button邊框

button::after{
border: none;
}

實際效果如下

這樣按鈕的邊框就消失了,單純的設置border:none和outline:none沒用。

小程序的分享事件

 /**
   * 用戶點擊分享
   */
  onShareAppMessage: function () {
   return { 
     title: '分享',
      desc: '活動描述', 
      path: '/xxx/xxxx?id=' + this.data.id
    } 
  },

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM