diff --git a/packages/taro-ui/src/components/button/index.tsx b/packages/taro-ui/src/components/button/index.tsx index bdbbcd06..40ebf133 100644 --- a/packages/taro-ui/src/components/button/index.tsx +++ b/packages/taro-ui/src/components/button/index.tsx @@ -79,7 +79,8 @@ export default class AtButton extends React.Component< sendMessagePath, sendMessageImg, showMessageCard, - appParameter + appParameter, + dataset } = this.props const { isWEAPP, isALIPAY, isWEB } = this.state const rootClassName = ['at-button'] @@ -128,6 +129,7 @@ export default class AtButton extends React.Component< onOpenSetting={this.onOpenSetting.bind(this)} onError={this.onError.bind(this)} onContact={this.onContact.bind(this)} + {...dataset} > ) diff --git a/packages/taro-ui/types/button.d.ts b/packages/taro-ui/types/button.d.ts index 23d79ea7..266b700e 100644 --- a/packages/taro-ui/types/button.d.ts +++ b/packages/taro-ui/types/button.d.ts @@ -53,6 +53,11 @@ export interface AtButtonProps extends AtComponent, TaroButtonProps { * @default false */ disabled?: boolean + /** + * 用于结合openType===share做分享按钮传值 + * @default undefined + */ + dataset?: Record /** * 点击按钮时触发 */