button设置了open-type=‘share’,如何放上分享图标呢?
发布于 5 年前 作者 fujing 11824 次浏览 来自 问答

button设置了open-type=‘share’,如何放上分享图标呢?

4 回复

button::after{

    display:none;

}

<button open-type="share">
<image src='/image/wx.png' class='button-image'></image>

<text class='button-text'>分享好友</text>

</button>


button {
  background-color:white;
  position:relative;
  display: flex;
  padding-left: 0rpx;
  padding-right: 0rpx;
  line-height: 0;
  overflow:visible;
  flex-direction: column;
  border: none;
  border-radius: 0;
  width: 80rpx;
  height: 76rpx;
  align-items: center;
}
 
button::after {
  border: none;
  border-radius: 0;
}

效果

那如何去掉button的本身背景

<button open-type='share'>

    <image src='your image url'></image>
</button>
<!-- 使用IconFont -->
<button open-type='share'>
    <view class='fa fa-share'></view>
</button>
  1. 在button里面插入图片(很low,不建议使用)

  2. 在button里面添加类名,用css设置背景(更low,不建议使用)

  3. 在button添加IconFont,使用方法https://image.wxopen.club/content_04efc606-3546-11ea-b236-a0999b08aadb.png

回到顶部