Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ name | type | default | description | required
-- | -- | -- | -- | --
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
activity-type | Number | - | \- | N
app-parameter | String | - | \- | N
block | Boolean | false | make button to be a block-level element | N
content | String | - | button's children elements | N
custom-dataset | any | - | \- | N
disabled | Boolean | undefined | disable the button, make it can not be clicked | N
entrance-path | String | - | \- | N
ghost | Boolean | false | make background-color to be transparent | N
hover-class | String | - | \- | N
hover-start-time | Number | 20 | \- | N
Expand All @@ -21,7 +23,8 @@ hover-stop-propagation | Boolean | false | \- | N
icon | String / Object | - | icon name | N
lang | String | - | message language。options: en/zh_CN/zh_TW | N
loading | Boolean | false | set button to be loading state | N
loading-props | Object | - | Typescript:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/button/type.ts) | N
loading-props | Object | - | Typescript: `LoadingProps`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/button/type.ts) | N
need-show-entrance | Boolean | true | \- | N
open-type | String | - | open type of button, [Miniprogram Button](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。options: contact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar/agreePrivacyAuthorization | N
phone-number-no-quota-toast | Boolean | true | \- | N
send-message-img | String | 截图 | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
-- | -- | -- | -- | --
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
activity-type | Number | - | 卡片id。 `open-type` 的值设置为 `liveActivity` ,设置 `activity-type` 参数为 [notify_type](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html)。当用户点击 `button` 后,可以通过 `bindcreateliveactivity` 事件回调获取到 `code` | N
app-parameter | String | - | 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 | N
block | Boolean | false | 是否为块级元素 | N
content | String | - | 按钮内容 | N
custom-dataset | any | - | 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取 | N
disabled | Boolean | undefined | 禁用状态。优先级:Button.disabled > Form.disabled | N
entrance-path | String | - | 从消息小程序入口打开小程序的路径,默认为聊天工具启动路径 | N
ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
hover-class | String | - | 指定按钮按下去的样式类,按钮不为加载或禁用状态时有效。当 `hover-class="none"` 时,没有点击态效果 | N
hover-start-time | Number | 20 | 按住后多久出现点击态,单位毫秒 | N
Expand All @@ -22,12 +24,13 @@ icon | String / Object | - | 图标名称。值为字符串表示图标名称,
lang | String | - | 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。<br />具体释义:<br />`en` 英文;<br />`zh_CN` 简体中文;<br />`zh_TW` 繁体中文。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。可选项:en/zh_CN/zh_TW | N
loading | Boolean | false | 是否显示为加载状态 | N
loading-props | Object | - | 透传 Loading 组件全部属性。TS 类型:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/button/type.ts) | N
need-show-entrance | Boolean | true | 转发的文本消息是否要带小程序入口 | N
open-type | String | - | 微信开放能力。<br />具体释义:<br />`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html">具体说明</a> (*鸿蒙 OS 暂不支持*);<br />`liveActivity` 通过前端获取<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html">新的一次性订阅消息下发机制</a>使用的 code;<br />`share` 触发用户转发,使用前建议先阅读<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#使用指引">使用指引</a>;<br />`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">具体说明</a> (*小程序插件中不能使用*);<br />`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 (*小程序插件中不能使用*);<br />`launchApp` 打开APP,可以通过 app-parameter 属性设定向 APP 传的参数<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html">具体说明</a>;<br />`openSetting` 打开授权设置页;<br />`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传<a href="https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html">日志</a>,开发者可以登录<a href="https://mp.weixin.qq.com/">小程序管理后台</a>后进入左侧菜单“客服反馈”页面获取到反馈内容;<br />`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;<br />`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html">小程序隐私协议开发指南</a>》。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)。可选项:contact/share/getPhoneNumber/getUserInfo/launchApp/openSetting/feedback/chooseAvatar/agreePrivacyAuthorization | N
phone-number-no-quota-toast | Boolean | true | 原生按钮属性,当手机号快速验证或手机号实时验证额度用尽时,是否对用户展示“申请获取你的手机号,但该功能使用次数已达当前小程序上限,暂时无法使用”的提示,默认展示,open-type="getPhoneNumber" 或 open-type="getRealtimePhoneNumber" 时有效 | N
send-message-img | String | 截图 | 会话内消息卡片图片,open-type="contact"时有效 | N
send-message-path | String | 当前分享路径 | 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 | N
send-message-title | String | 当前标题 | 会话内消息卡片标题,open-type="contact"时有效 | N
session-from | String | - | 会话来源,open-type="contact"时有效 | N
session-from | String | - | 会话来源,open-type="contact"时有效,长度不超过 1024 个字符 | N
shape | String | rectangle | 按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形。可选项:rectangle/square/round/circle | N
show-message-card | Boolean | false | 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,open-type="contact"时有效 | N
size | String | medium | 组件尺寸。可选项:extra-small/small/medium/large | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

import { TdButtonProps } from './type';
const props: TdButtonProps = {
/** 卡片id。 `open-type` 的值设置为 `liveActivity` ,设置 `activity-type` 参数为 [notify_type](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html)。当用户点击 `button` 后,可以通过 `bindcreateliveactivity` 事件回调获取到 `code` */
activityType: {
type: Number,
},
/** 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 */
appParameter: {
type: String,
Expand All @@ -29,6 +33,11 @@ const props: TdButtonProps = {
type: null,
value: undefined,
},
/** 从消息小程序入口打开小程序的路径,默认为聊天工具启动路径 */
entrancePath: {
type: String,
value: '',
},
/** 是否为幽灵按钮(镂空按钮) */
ghost: {
type: Boolean,
Expand Down Expand Up @@ -71,6 +80,11 @@ const props: TdButtonProps = {
loadingProps: {
type: Object,
},
/** 转发的文本消息是否要带小程序入口 */
needShowEntrance: {
type: Boolean,
value: true,
},
/** 微信开放能力。<br />具体释义:<br />`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html">具体说明</a> (*鸿蒙 OS 暂不支持*);<br />`liveActivity` 通过前端获取<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html">新的一次性订阅消息下发机制</a>使用的 code;<br />`share` 触发用户转发,使用前建议先阅读<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#使用指引">使用指引</a>;<br />`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">具体说明</a> (*小程序插件中不能使用*);<br />`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 (*小程序插件中不能使用*);<br />`launchApp` 打开APP,可以通过 app-parameter 属性设定向 APP 传的参数<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html">具体说明</a>;<br />`openSetting` 打开授权设置页;<br />`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传<a href="https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html">日志</a>,开发者可以登录<a href="https://mp.weixin.qq.com/">小程序管理后台</a>后进入左侧菜单“客服反馈”页面获取到反馈内容;<br />`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;<br />`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html">小程序隐私协议开发指南</a>》。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html) */
openType: {
type: String,
Expand All @@ -95,7 +109,7 @@ const props: TdButtonProps = {
type: String,
value: '当前标题',
},
/** 会话来源,open-type="contact"时有效 */
/** 会话来源,open-type="contact"时有效,长度不超过 1024 个字符 */
sessionFrom: {
type: String,
value: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
import { LoadingProps } from '../loading/index';

export interface TdButtonProps {
/**
* 卡片id。 `open-type` 的值设置为 `liveActivity` ,设置 `activity-type` 参数为 [notify_type](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html)。当用户点击 `button` 后,可以通过 `bindcreateliveactivity` 事件回调获取到 `code`
*/
activityType?: {
type: NumberConstructor;
value?: number;
};
/**
* 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效
* @default ''
Expand Down Expand Up @@ -44,6 +51,14 @@ export interface TdButtonProps {
type: BooleanConstructor;
value?: boolean;
};
/**
* 从消息小程序入口打开小程序的路径,默认为聊天工具启动路径
* @default ''
*/
entrancePath?: {
type: StringConstructor;
value?: string;
};
/**
* 是否为幽灵按钮(镂空按钮)
* @default false
Expand Down Expand Up @@ -113,6 +128,14 @@ export interface TdButtonProps {
type: ObjectConstructor;
value?: LoadingProps;
};
/**
* 转发的文本消息是否要带小程序入口
* @default true
*/
needShowEntrance?: {
type: BooleanConstructor;
value?: boolean;
};
/**
* 微信开放能力。<br />具体释义:<br />`contact` 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从 bindcontact 回调中获得具体信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html">具体说明</a> (*鸿蒙 OS 暂不支持*);<br />`liveActivity` 通过前端获取<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html">新的一次性订阅消息下发机制</a>使用的 code;<br />`share` 触发用户转发,使用前建议先阅读<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#使用指引">使用指引</a>;<br />`getPhoneNumber` 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html">具体说明</a> (*小程序插件中不能使用*);<br />`getUserInfo` 获取用户信息,可以从 bindgetuserinfo 回调中获取到用户信息 (*小程序插件中不能使用*);<br />`launchApp` 打开APP,可以通过 app-parameter 属性设定向 APP 传的参数<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html">具体说明</a>;<br />`openSetting` 打开授权设置页;<br />`feedback` 打开“意见反馈”页面,用户可提交反馈内容并上传<a href="https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html">日志</a>,开发者可以登录<a href="https://mp.weixin.qq.com/">小程序管理后台</a>后进入左侧菜单“客服反馈”页面获取到反馈内容;<br />`chooseAvatar` 获取用户头像,可以从 bindchooseavatar 回调中获取到头像信息;<br />`agreePrivacyAuthorization`用户同意隐私协议按钮。用户点击一次此按钮后,所有隐私接口可以正常调用。可通过`bindagreeprivacyauthorization`监听用户同意隐私协议事件。隐私合规开发指南详情可见《<a href="https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html">小程序隐私协议开发指南</a>》。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)
*/
Expand Down Expand Up @@ -162,7 +185,7 @@ export interface TdButtonProps {
value?: string;
};
/**
* 会话来源,open-type="contact"时有效
* 会话来源,open-type="contact"时有效,长度不超过 1024 个字符
* @default ''
*/
sessionFrom?: {
Expand Down
113 changes: 112 additions & 1 deletion packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -14459,6 +14459,43 @@
],
"field_type_text": []
},
{
"id": 1769581756,
"platform_framework": [
"64"
],
"component": "Button",
"field_category": 1,
"field_name": "activityType",
"field_type": [
"2"
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "卡片id。 `open-type` 的值设置为 `liveActivity` ,设置 `activity-type` 参数为 [notify_type](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message-2.html)。当用户点击 `button` 后,可以通过 `bindcreateliveactivity` 事件回调获取到 `code`",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2026-01-28 06:29:16",
"update_time": "2026-01-28 06:29:16",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Miniprogram"
],
"field_type_text": [
"Number"
]
},
{
"id": 1709459753,
"platform_framework": [
Expand Down Expand Up @@ -14750,6 +14787,43 @@
"Boolean"
]
},
{
"id": 1769581302,
"platform_framework": [
"64"
],
"component": "Button",
"field_category": 1,
"field_name": "entrancePath",
"field_type": [
"1"
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "从消息小程序入口打开小程序的路径,默认为聊天工具启动路径",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2026-01-28 06:21:42",
"update_time": "2026-01-28 06:21:42",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Miniprogram"
],
"field_type_text": [
"String"
]
},
{
"id": 1725604537,
"platform_framework": [
Expand Down Expand Up @@ -15263,6 +15337,43 @@
"Object"
]
},
{
"id": 1769581268,
"platform_framework": [
"64"
],
"component": "Button",
"field_category": 1,
"field_name": "needShowEntrance",
"field_type": [
"4"
],
"field_default_value": "true",
"field_enum": "",
"field_desc_zh": "转发的文本消息是否要带小程序入口",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
"create_time": "2026-01-28 06:21:08",
"update_time": "2026-01-28 06:21:08",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Miniprogram"
],
"field_type_text": [
"Boolean"
]
},
{
"id": 1709458728,
"platform_framework": [
Expand Down Expand Up @@ -15461,7 +15572,7 @@
],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "会话来源,open-type=\"contact\"时有效",
"field_desc_zh": "会话来源,open-type=\"contact\"时有效,长度不超过 1024 个字符",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
Expand Down