Button

按钮

属性

属性

类型

默认值

必填

说明

最低版本

size

string

default

default; mini

1.0.0

type

string

default

primary; default; warn

1.0.0

plain

boolean

false

按钮是否镂空,背景色透明

1.0.0

disabled

boolean

false

是否禁用

1.0.0

loading

boolean

false

名称前是否带 loading 图标

1.0.0

form-type

string

用于 form 组件,点击分别会触发 form 组件的 submit/reset 事件

1.0.0

open-type

string

微信开放能力

1.1.0

hover-class

string

button-hover

指定按钮按下去的样式类。当 hover-class="none" 时,没有点击态效果

1.0.0

hover-stop-propagation

boolean

false

指定是否阻止本节点的祖先节点出现点击态

1.5.0

hover-start-time

number

20

按住后多久出现点击态,单位毫秒

1.0.0

hover-stay-time

number

70

手指松开后点击态保留时间,单位毫秒

1.0.0

lang

string

en

指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。

1.3.0

session-from

string

会话来源,open-type="contact"时有效

1.4.0

send-message-title

string

当前标题

会话内消息卡片标题,open-type="contact"时有效

1.5.0

send-message-path

string

当前分享路径

会话内消息卡片点击跳转小程序路径,open-type="contact"时有效

1.5.0

send-message-img

string

截图

会话内消息卡片图片,open-type="contact"时有效

1.5.0

app-parameter

string

打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效

1.9.5

show-message-card

boolean

false

是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,open-type="contact"时有效

1.5.0

bindgetuserinfo

eventhandle

用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与wx.getUserInfo返回的一致,open-type="getUserInfo"时有效

1.3.0

bindcontact

eventhandle

客服消息回调,open-type="contact"时有效

1.5.0

bindgetphonenumber

eventhandle

获取用户手机号回调,open-type=getPhoneNumber时有效

1.2.0

binderror

eventhandle

当使用开放能力时,发生错误的回调,open-type=launchApp时有效

1.9.5

bindopensetting

eventhandle

在打开授权设置页后回调,open-type=openSetting时有效

2.0.7

bindlaunchapp

eventhandle

打开 APP 成功的回调,open-type=launchApp时有效

2.4.4

Last updated