当我们想用button包裹图片之类的东西,想保留button的能力,但又不想要其样式
一句代码解决
<button style="display: contents;" open-type="share">
<image src="/assets/share.png" style="width: 60rpx;height: 60rpx;margin-left: 20rpx;"></image>
</button>
设置了display: contents的元素本身不会被渲染,但是其子元素能够正常被渲染
第二种,给button加样式
.btn{
margin: 0;
padding: 0;
background: transparent;
border: none;
}
.btn::after{
border: none;
}