文檔
- https://developers.weixin.qq.com/miniprogram/dev/component/button.html
打開客服會話
按鈕關鍵屬性
open-type="contact"
功能按鈕
<button class="mo-open-type"open-type="contact">
</button>
分享
<button class="mo-open-type" open-type="share"></button>
css樣式
父元素需要設置為相對定位,使用障眼法,將按鈕元素隱藏,避免影響當前布局和樣式
.mo-open-type {position: absolute;width: 100%;height: 100%;top: 0;left: 0;background-color: transparent;padding: 0;margin: 0;
}.mo-open-type::after {border: none;
}
或者
.mo-open-type {position: absolute;width: 100%;height: 100%;top: 0;left: 0;opacity: 0;
}