button设置open-type="share"点击按钮一定会触发分享吗?能动态设置吗?

小程序 文章 2021-12-28 10:40 9 0 全屏看文

button设置open-type="share"点击按钮一定会触发分享吗?能动态设置吗?The button setting open-type="share" will trigger sharing when the button is clicked? Can it be set dynamically?

button设置open-type="share"点击按钮一定会触发分享吗?能动态设置吗?

我要如何做到,当要分享内容为空时不触发onShareAppMessage: function弹出为空提示呢。有大佬知道怎么解决吗?

How can I do this without triggering the onshareappmessage: function pop-up empty prompt when the content to be shared is empty. Do any big guys know how to solve it?

回答:

brave:
<button openType="share" wx:if="{{shareData}}">share</button>or<button openType="{{shareData ? 'share' : ''}}">share</button>
微喵网络:

<button wx:if

张庭山:

写2个button

-EOF-