Skip to content

Commit

Permalink
fix(Button): customDataset attribute type changed to any (#3179)
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao authored Oct 9, 2024
1 parent b3466bc commit 187ac96
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/button/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on v
app-parameter | String | - | \- | N
block | Boolean | false | make button to be a block-level element | N
content | String / Slot | - | button's children elements。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
custom-dataset | Object | - | Typescript:`any` | N
custom-dataset | any | - | \- | N
disabled | Boolean | undefined | disable the button, make it can not be clicked | N
ghost | Boolean | false | make background-color to be transparent | N
hover-class | String | - | \- | N
Expand Down Expand Up @@ -127,7 +127,6 @@ t-class | \-
t-class-icon | class name of icon
t-class-loading | class name of loading


### CSS Variables

The component provides the following CSS variables, which can be used to customize styles.
Expand Down Expand Up @@ -231,4 +230,4 @@ Name | Default Value | Description
--td-button-small-font-size | @font-size-base | -
--td-button-small-height | 64rpx | -
--td-button-small-icon-font-size | 36rpx | -
--td-button-small-padding-horizontal | 24rpx | -
--td-button-small-padding-horizontal | 24rpx | -
5 changes: 2 additions & 3 deletions src/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场
app-parameter | String | - | 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 | N
block | Boolean | false | 是否为块级元素 | N
content | String / Slot | - | 按钮内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
custom-dataset | Object | - | 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取。。TS 类型:`any` | N
custom-dataset | any | - | 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取 | N
disabled | Boolean | undefined | 禁用状态。优先级:Button.disabled > Form.disabled | N
ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
hover-class | String | - | 指定按钮按下去的样式类,按钮不为加载或禁用状态时有效。当 `hover-class="none"` 时,没有点击态效果 | N
Expand Down Expand Up @@ -129,7 +129,6 @@ t-class | 根节点样式类
t-class-icon | 图标样式类
t-class-loading | 加载样式类


### CSS Variables

组件提供了下列 CSS 变量,可用于自定义样式。
Expand Down Expand Up @@ -233,4 +232,4 @@ t-class-loading | 加载样式类
--td-button-small-font-size | @font-size-base | -
--td-button-small-height | 64rpx | -
--td-button-small-icon-font-size | 36rpx | -
--td-button-small-padding-horizontal | 24rpx | -
--td-button-small-padding-horizontal | 24rpx | -
4 changes: 2 additions & 2 deletions src/button/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const props: TdButtonProps = {
content: {
type: String,
},
/** 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取 */
/** 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取 */
customDataset: {
type: Object,
type: null,
},
/** 禁用状态。优先级:Button.disabled > Form.disabled */
disabled: {
Expand Down
6 changes: 3 additions & 3 deletions src/button/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export interface TdButtonProps {
value?: string;
};
/**
* 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取
* 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取
*/
customDataset?: {
type: ObjectConstructor;
value?: any;
type: null;
value?: null;
};
/**
* 禁用状态。优先级:Button.disabled > Form.disabled
Expand Down

0 comments on commit 187ac96

Please sign in to comment.