diff --git a/components/ui-btn/ui-btn.js b/components/ui-btn/ui-btn.js index c37580c..1ee0673 100644 --- a/components/ui-btn/ui-btn.js +++ b/components/ui-btn/ui-btn.js @@ -6,7 +6,13 @@ Component({ block: { type: Boolean, value: false }, disabled: { type: Boolean, value: false }, iconSrc: { type: String, value: '' }, - customStyle: { type: String, value: '' } + customStyle: { type: String, value: '' }, + // 透传微信原生 button 的 open-type: + // share — 触发 Page.onShareAppMessage(分享给朋友) + // contact / feedback / shareToPhone … 等 + // 设置后会在底层 button 上挂 open-type="{{openType}}",配合 Page 的 + // onShareAppMessage 即可让自定义按钮真正调起原生分享面板。 + openType: { type: String, value: '' } }, methods: { onTap() { diff --git a/components/ui-btn/ui-btn.wxml b/components/ui-btn/ui-btn.wxml index d15d430..f8c3950 100644 --- a/components/ui-btn/ui-btn.wxml +++ b/components/ui-btn/ui-btn.wxml @@ -3,6 +3,7 @@ style="{{customStyle}}" bindtap="onTap" disabled="{{disabled}}" + open-type="{{openType}}" hover-class="none" > ` / `