Skip to content

Commit

Permalink
fix: button支持dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyongming committed Oct 11, 2024
1 parent 4efa4b5 commit 1ee0887
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/taro-ui/src/components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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}
></Button>
)

Expand Down
5 changes: 5 additions & 0 deletions packages/taro-ui/types/button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export interface AtButtonProps extends AtComponent, TaroButtonProps {
* @default false
*/
disabled?: boolean
/**
* 用于结合openType===share做分享按钮传值
* @default undefined
*/
dataset?: Record<string, any>
/**
* 点击按钮时触发
*/
Expand Down

0 comments on commit 1ee0887

Please sign in to comment.