html
<view class="share-img-box">
<image src="../../static/home/share.png" style="width: 38upx;height: 38upx;" mode=""></image>
<button open-type="share" bindcontact="handleContact" class="openChat"></button>
</view>
css 此处用的 scss
.share-img-box {
width: 38upx;
height: 38upx;
position: relative;
.openChat{
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
z-index: 999;
}
}
这样布局可以自定义button按钮样式,解决button按钮有边框的问题。