From 1ee088759818e8d08145ebfe8efaeceeb60d2770 Mon Sep 17 00:00:00 2001 From: yangyongming Date: Fri, 11 Oct 2024 13:35:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20button=E6=94=AF=E6=8C=81dataset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-ui/src/components/button/index.tsx | 4 +++- packages/taro-ui/types/button.d.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 /** * 点击按钮时触发 */