UNPKG

24.6 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps, CommonEventFunction } from './common'
3import { StyleProp, ViewStyle } from 'react-native'
4interface ButtonProps extends StandardProps {
5 /** 按钮的大小
6 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
7 * @default default
8 */
9 size?: keyof ButtonProps.Size
10 /** 按钮的样式类型
11 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
12 * @default default
13 */
14 type?: keyof ButtonProps.Type
15 /** 按钮是否镂空,背景色透明
16 * @supported weapp, alipay, swan, qq, jd, h5, rn, harmony_hybrid
17 * @default false
18 */
19 plain?: boolean
20 /** 是否禁用
21 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
22 * @default false
23 */
24 disabled?: boolean
25 /** 名称前是否带 loading 图标
26 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
27 * @default false
28 */
29 loading?: boolean
30 /** 用于 `<form/>` 组件,点击分别会触发 `<form/>` 组件的 submit/reset 事件
31 * @supported weapp, alipay, swan, tt, qq, jd
32 */
33 formType?: keyof ButtonProps.FormType
34 /** 微信开放能力
35 * @supported weapp, alipay, swan, tt, qq, jd
36 */
37 openType?: ButtonProps.OpenType
38 /** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
39 * @default button-hover
40 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
41 * @rn 支持 hoverStyle 属性,但框架未支持 hoverClass
42 */
43 hoverClass?: string
44 /** 由于 RN 不支持 hoverClass,故 RN 端的 Button 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
45 * @default none
46 * @supported rn
47 */
48 hoverStyle?: StyleProp<ViewStyle>
49 /** 指定是否阻止本节点的祖先节点出现点击态
50 * @default false
51 * @supported weapp, alipay, swan, tt, qq, jd
52 */
53 hoverStopPropagation?: boolean
54 /** 按住后多久出现点击态,单位毫秒
55 * @default 20
56 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
57 */
58 hoverStartTime?: number
59 /** 手指松开后点击态保留时间,单位毫秒
60 * @default 70
61 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
62 */
63 hoverStayTime?: number
64 /** 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。
65 *
66 * 生效时机: `open-type="getUserInfo"`
67 * @supported weapp, qq, jd
68 */
69 lang?: keyof ButtonProps.Lang
70 /** 会话来源
71 *
72 * 生效时机:`open-type="contact"`
73 * @supported weapp, swan
74 */
75 sessionFrom?: string
76 /** 会话内消息卡片标题
77 *
78 * 生效时机:`open-type="contact"`
79 * @default 当前标题
80 * @supported weapp, swan
81 */
82 sendMessageTitle?: string
83 /** 会话内消息卡片点击跳转小程序路径
84 *
85 * 生效时机:`open-type="contact"`
86 * @default 当前标题
87 * @supported weapp, swan
88 */
89 sendMessagePath?: string
90 /** 会话内消息卡片图片
91 *
92 * 生效时机:`open-type="contact"`
93 * @default 截图
94 * @supported weapp, swan
95 */
96 sendMessageImg?: string
97 /** 打开 APP 时,向 APP 传递的参数
98 *
99 * 生效时机:`open-type="launchApp"`
100 * @supported weapp, qq, jd
101 */
102 appParameter?: string
103 /** 支付宝小程序 scope
104 *
105 * 生效时机:`open-type="getAuthorize"`
106 * @supported alipay
107 */
108 scope?: 'userInfo' | 'phoneNumber'
109 /** 显示会话内消息卡片
110 *
111 * 生效时机:`open-type="contact"`
112 * @supported weapp, swan
113 * @default false
114 */
115 showMessageCard?: boolean
116 /** 生活号 id,必须是当前小程序同主体且已关联的生活号,open-type="lifestyle" 时有效。
117 * @supported alipay, qq
118 */
119 publicId?: string
120 /** 发送订阅类模板消息所用的模板库标题 ID ,可通过 getTemplateLibraryList 获取
121 * 当参数类型为 Array 时,可传递 1~3 个模板库标题 ID
122 * @supported swan
123 */
124 templateId?: string | Array<string>
125 /** 发送订阅类模板消息时所使用的唯一标识符,内容由开发者自定义,用来标识订阅场景
126 * 注意:同一用户在同一 subscribe-id 下的多次授权不累积下发权限,只能下发一条。若要订阅多条,需要不同 subscribe-id
127 * @supported swan
128 */
129 subscribeId?: string
130 /** 群聊 id
131 * @qq 打开群资料卡时,传递的群号
132 * @tt 通过创建聊天群、查询群信息获取
133 * @supported qq, tt
134 */
135 groupId?: string
136 /** 打开频道页面时,传递的频道号
137 * @supported qq
138 */
139 guildId?: string
140 /** 分享类型集合,请参考下面share-type有效值说明。share-type后续将不再维护,请更新为share-mode
141 * @supported qq
142 * @default 27
143 */
144 shareType?: string
145 /** 分享类型集合,请参考下面share-mode有效值说明
146 * @supported qq
147 * @default ['qq', 'qzone']
148 */
149 shareMode?: string
150 /** 无障碍访问,(属性)元素的额外描述
151 * @supported qq
152 */
153 ariaLabel?: string
154 /** 添加好友时,对方的 openid
155 * @supported qq
156 */
157 openId?: string
158 /** 发送对象的 FriendInfo
159 * @supported qq
160 */
161 shareMessageFriendInfo?: string
162 /** 转发标题,不传则默认使用当前小程序的昵称。 FriendInfo
163 * @supported qq
164 */
165 shareMessageTitle?: string
166 /** 转发显示图片的链接,可以是网络图片路径(仅 QQ CDN 域名路径)或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4FriendInfo
167 * @supported qq
168 */
169 shareMessageImg?: string
170 /** 跳转抖音号个人页,只支持小程序绑定的品牌号、员工号、合作号
171 * @supported tt
172 */
173 dataAwemeId?: string
174 /**
175 * 是否开启半屏模式
176 * @supported tt
177 */
178 dataIsHalfPage?: boolean
179 /** 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与 Taro.getUserInfo 返回的一致
180 *
181 * 生效时机: `open-type="getUserInfo"`
182 * @supported weapp, alipay, swan, qq, jd
183 */
184 onGetUserInfo?: CommonEventFunction<ButtonProps.onGetUserInfoEventDetail>
185 /** 支付宝获取会员基础信息授权回调
186 *
187 * 生效时机:`open-type="getAuthorize"`
188 * @supported alipay
189 */
190 onGetAuthorize?: CommonEventFunction
191 /** 客服消息回调
192 *
193 * 生效时机:`open-type="contact"`
194 * @supported weapp, swan, qq
195 */
196 onContact?: CommonEventFunction<ButtonProps.onContactEventDetail>
197 /** 获取用户手机号回调
198 *
199 * 生效时机:`open-type="getPhoneNumber"`
200 * @supported weapp, alipay, swan, tt, jd
201 */
202 onGetPhoneNumber?: CommonEventFunction<ButtonProps.onGetPhoneNumberEventDetail>
203 /**
204 * 手机号实时验证回调,`open-type="getRealtimePhoneNumber"` 时有效
205 * @supported weapp
206 */
207 onGetRealTimePhoneNumber?: CommonEventFunction<ButtonProps.onGetRealTimePhoneNumberEventDetail>
208 /** 当使用开放能力时,发生错误的回调
209 *
210 * 生效时机:`open-type="launchApp"`
211 * @supported weapp, alipay, qq, jd
212 */
213 onError?: CommonEventFunction
214 /** 在打开授权设置页后回调
215 *
216 * 生效时机:`open-type="openSetting"`
217 * @supported weapp, swan, tt, qq, jd
218 */
219 onOpenSetting?: CommonEventFunction<ButtonProps.onOpenSettingEventDetail>
220 /** 打开 APP 成功的回调
221 *
222 * 生效时机:`open-type="launchApp"`
223 * @supported weapp, qq
224 */
225 onLaunchApp?: CommonEventFunction
226 /** 获取用户头像回调
227 *
228 * 生效时机:`open-type="chooseAvatar"`
229 * @supported weapp
230 */
231 onChooseAvatar?: CommonEventFunction
232 /**
233 * 用户同意隐私协议事件回调,`open-type="agreePrivacyAuthorization"`时有效
234 * @supported weapp
235 */
236 onAgreePrivacyAuthorization?: CommonEventFunction
237 /** 点击。
238 * 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。
239 * @supported alipay
240 */
241 onTap?: CommonEventFunction
242 /** 当 open-type 为 lifestyle 时有效。
243 * 当点击按钮时触发。
244 * event.detail = { followStatus },followStatus 合法值有 1、2、3,其中 1 表示已关注。2 表示用户不允许关注。3 表示发生未知错误;
245 * 已知问题:基础库 1.0,当用户在点击按钮前已关注生活号,event.detail.followStatus 的值为 true。
246 * @supported alipay
247 */
248 onFollowLifestyle?: CommonEventFunction<{
249 followStatus: 1 | 2 | 3 | true
250 }>
251 /** 用户点击该按钮时,调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址,从返回参数的 detail 中获取,和 swan.chooseAddress 一样的。和 open-type 搭配使用,使用时机:open-type="chooseAddress"
252 * @supported swan
253 */
254 onChooseAddress?: CommonEventFunction
255 /** 用户点击该按钮时,选择用户的发票抬头,和 swan.chooseInvoiceTitle 一样的。和 open-type 搭配使用,使用时机:open-type="chooseInvoiceTitle"
256 * @supported swan
257 */
258 onChooseInvoiceTitle?: CommonEventFunction
259 /** 登录回调,和 open-type 搭配使用,使用时机:open-type="login"。可以通过返回参数的 detail 判断是否登录成功,当 errMsg 为'login:ok'时即为成功。如想获取登录凭证请使用 swan.getLoginCode
260 * @supported swan
261 */
262 onLogin?: CommonEventFunction
263 /** 订阅消息授权回调,和 open-type 搭配使用,使用时机:open-type="subscribe"
264 * @supported swan
265 */
266 onSubscribe?: CommonEventFunction
267 /** 添加好友的回调
268 * @supported qq
269 */
270 onAddFriend?: CommonEventFunction
271 /** 添加群应用的回调。errCode 错误码:41004(当前用户非管理员或群主,无权操作),41005(超过可添加群应用的群数量)
272 * @supported qq
273 */
274 onAddGroupApp?: CommonEventFunction
275 /** 监听跳转抖音号个人页的回调
276 *
277 * 生效时机:`open-type="openAwemeUserProfile"`
278 * @supported tt
279 */
280 onOpenAwemeUserProfile?: CommonEventFunction
281 /**
282 * 加群后触发
283 * @supported tt
284 */
285 onJoinGroup?: CommonEventFunction<{ errMsg: string; errNo: number }>
286}
287declare namespace ButtonProps {
288 /** size 的合法值 */
289 interface Size {
290 /** 默认大小 */
291 default
292 /** 小尺寸 */
293 mini
294 }
295 /** type 的合法值 */
296 interface Type {
297 /** 绿色 */
298 primary
299 /** 白色 */
300 default
301 /** 红色 */
302 warn
303 }
304 /** form-type 的合法值 */
305 interface FormType {
306 /** 提交表单 */
307 submit
308 /** 重置表单 */
309 reset
310 }
311 /** open-type 的合法值 */
312 type OpenType =
313 | keyof openTypeKeys['weapp']
314 | keyof openTypeKeys['alipay']
315 | keyof openTypeKeys['qq']
316 | keyof openTypeKeys['tt']
317 /** open-type 的合法值 */
318 interface openTypeKeys {
319 weapp: {
320 /** 打开客服会话,如果用户在会话中点击消息卡片后返回小程序,可以从回调中获得具体信息
321 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/customer-message.html
322 */
323 contact
324 /** 触发用户转发,使用前建议先阅读使用指引
325 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%BC%95
326 */
327 share
328 /** 获取用户手机号,可以从回调中获取到用户信息
329 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html
330 */
331 getPhoneNumber
332 /**
333 * 手机号实时验证,向用户申请,并在用户同意后,快速填写和实时验证手机号。(*小程序插件中不能使用*)
334 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getRealtimePhoneNumber.html
335 */
336 getRealtimePhoneNumber
337 /** 获取用户信息,可以从回调中获取到用户信息 */
338 getUserInfo
339 /** 打开APP,可以通过 app-parameter 属性设定向APP传的参数
340 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/launchApp.html
341 */
342 launchApp
343 /** 打开授权设置页 */
344 openSetting
345 /** 打开“意见反馈”页面,用户可提交反馈内容并上传日志,开发者可以登录小程序管理后台后进入左侧菜单“客服反馈”页面获取到反馈内容 */
346 feedback
347 /** 获取用户头像,可以从回调中获得具体信息 */
348 chooseAvatar
349 /**
350 * 用户同意隐私协议按钮。可通过 bindagreeprivacyauthorization 监听用户同意隐私协议事件
351 */
352 agreePrivacyAuthorization
353 /**
354 * 从基础库 2.32.3 版本起,隐私同意按钮支持与手机号快速验证组件耦合使用,调用方式为:
355 * <button open-type="getPhoneNumber|agreePrivacyAuthorization">
356 */
357 ['getPhoneNumber|agreePrivacyAuthorization']
358 /**
359 * 从基础库 2.32.3 版本起,支持隐私同意按钮与手机号实时验证组件耦合使用,调用方式为:
360 * <button open-type="getRealtimePhoneNumber|agreePrivacyAuthorization">
361 */
362 ['getRealtimePhoneNumber|agreePrivacyAuthorization']
363 /**
364 * 从基础库 2.32.3 版本起,支持隐私同意按钮与获取用户信息组件耦合使用,调用方式为:
365 * <button open-type="getUserInfo|agreePrivacyAuthorization">
366 */
367 ['getUserInfo|agreePrivacyAuthorization']
368 }
369 /** 支付宝小程序专属的 open-type 合法值
370 * @see https://opendocs.alipay.com/mini/component/button
371 */
372 alipay: {
373 /** 触发 自定义分享 */
374 share
375 /** 支持小程序授权 */
376 getAuthorize
377 /** 分享到通讯录好友 */
378 contactShare
379 /** 关注生活号 */
380 lifestyle
381 }
382 /** QQ 小程序专属的 open-type 合法值
383 * @see https://q.qq.com/wiki/develop/miniprogram/component/form/button.html
384 */
385 qq: {
386 /** 触发用户转发,使用前建议先阅读使用指引
387 * @see https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_share.html#%E8%BD%AC%E5%8F%91-2
388 */
389 share
390 /** 获取用户信息,可以从 onGetUserInfo 回调中获取到用户信息 */
391 getUserInfo
392 /** 打开APP,可以通过 app-parameter 属性设定向APP传的参数
393 * @see https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_app.html
394 */
395 launchApp
396 /** 打开授权设置页 */
397 openSetting
398 /** 呼起吐个槽反馈页面,开发者可以到官网查看反馈 */
399 feedback
400 /** 呼起群资料卡页面,可以通过 group-id 属性设定需要打开的群资料卡的群号,同时 app.json 中必须配置 groupIdList(数量不超过 10 个),表明可以打开群资料卡的群号 */
401 openGroupProfile
402 /** 添加好友,对方需要通过该小程序进行授权,允许被加好友后才能调用成功[用户授权](https://q.qq.com/wiki/develop/miniprogram/frame/open_ability/open_userinfo.html#%E6%8E%88%E6%9D%83) */
403 addFriend
404 /** 添加彩签,点击后添加状态有用户提示,无回调 */
405 addColorSign
406 /** 打开公众号资料卡,可以通过 public-id 属性设定需要打开的公众号资料卡的号码,同时 app.json 中必须配置 publicIdList(目前只能配置 1 个),表明可以打开的公众号资料卡的号码 */
407 openPublicProfile
408 /** 添加群应用(只有管理员或群主有权操作,建议先调用 qq.getGroupInfo 获取当前用户是否为管理员,如果是管理员才显示该按钮),添加后给button绑定 onAddGroupApp 事件接收回调数据。 */
409 addGroupApp
410 /** 在自定义开放数据域组件中,向指定好友发起分享据 */
411 shareMessageToFriend
412 }
413 /** TT 小程序专属的 open-type 合法值
414 * @see https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/component/list/button/#open-type-%E7%9A%84%E5%90%88%E6%B3%95%E5%80%BC
415 */
416 tt: {
417 /** 触发用户转发, 可以配合 data-channel 属性来设置分享的 channel,具体请参考 ShareParam */
418 share
419 /** 获取用户手机号,可以从 bindgetphonenumber 回调中获取到用户信息,详情请参见获取手机号 */
420 getPhoneNumber
421 /** 跳转到抖音IM客服,详情请参见抖音IM客服能力 */
422 im
423 /** 跳转到抖音平台客服,详情请参见平台客服能力 */
424 platformIm
425 /** 跳转视频播放页,详情请参见跳转视频播放页 */
426 navigateToVideoView
427 /** 跳转抖音号个人页,详情请参见跳转抖音号个人页 */
428 openAwemeUserProfile
429 /** 跳转抖音直播间,详情请参见跳转抖音直播间 */
430 openWebcastRoom
431 /** 写入系统日历,详情请参见写入系统日历 */
432 addCalendarEvent
433 /** 添加到桌面,详情请参见添加到桌面 */
434 addShortcut
435 /** 加群,详情请参见加群 */
436 joinGroup
437 /** 私信,详情请参见私信 */
438 privateMessage
439 /** 主动授权私信,详情请参见主动授权私信 */
440 authorizePrivateMessage
441 }
442 }
443 /** lang 的合法值 */
444 interface Lang {
445 /** 英文 */
446 en
447 /** 简体中文 */
448 zh_CN
449 /** 繁体中文 */
450 zh_TW
451 }
452 interface onGetUserInfoEventDetail {
453 userInfo: {
454 /** 昵称 */
455 nickName: string
456 /** 头像链接 */
457 avatarUrl: string
458 /** 头像
459 * @supported alipay
460 */
461 avatar: string
462 /** 性别 */
463 gender: keyof Gender
464 /** 省份,如:`Yunnan` */
465 province: string
466 /** 城市,如:`Dalian` */
467 city: string
468 /** 国家,如:`China` */
469 country: string
470 }
471 /** 不包括敏感信息的原始数据 `JSON` 字符串,用于计算签名 */
472 rawData: string
473 /** 使用 `sha1(rawData + sessionkey)` 得到字符串,用于校验用户信息 */
474 signature: string
475 /** 包括敏感数据在内的完整用户信息的加密数据 */
476 encryptedData: string
477 /** 加密算法的初始向量 */
478 iv: string
479 /* 用户信息的调用状态 */
480 errMsg: string
481 /** 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#method-cloud) */
482 cloudID?: string
483 }
484 /** 性别的合法值 */
485 interface Gender {
486 /** 未知 */
487 0
488 /** 男 */
489 1
490 /** 女 */
491 2
492 }
493 interface onContactEventDetail {
494 /* 小程序消息的调用状态 */
495 errMsg: string
496 /** 小程序消息指定的路径 */
497 path: string
498 /** 小程序消息指定的查询参数 */
499 query: Record<string, any>
500 }
501 interface onGetPhoneNumberEventDetail {
502 /* 获取用户手机号的调用状态 */
503 errMsg: string
504 /** 包括敏感数据在内的完整用户信息的加密数据 */
505 encryptedData: string
506 /** 加密算法的初始向量 */
507 iv: string
508 /** 动态令牌。可通过动态令牌换取用户手机号。
509 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%BC%95
510 */
511 code?: string
512 /**
513 * 签名信息,如果在开放平台后台配置了加签方式后有此字段
514 * @supported alipay
515 */
516 sign: string
517 }
518 interface onGetRealTimePhoneNumberEventDetail {
519 code: string
520 }
521 interface onOpenSettingEventDetail {
522 /* 打开授权设置页的调用状态 */
523 errMsg: string
524 /* 用户授权结果 */
525 authSetting: Record<string, boolean>
526 }
527}
528/** 按钮
529 * @classification forms
530 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid
531 * @example_react
532 * ```tsx
533 * export default class PageButton extends Component {
534 * state = {
535 * btn: [
536 * {
537 * text: '页面主操作 Normal',
538 * size: 'default',
539 * type: 'primary'
540 * },
541 * {
542 * text: '页面主操作 Loading',
543 * size: 'default',
544 * type: 'primary',
545 * loading: true,
546 * },
547 * {
548 * text: '页面主操作 Disabled',
549 * size: 'default',
550 * type: 'primary',
551 * disabled: true,
552 * },
553 * {
554 * text: '页面次要操作 Normal',
555 * size: 'default',
556 * type: 'default'
557 * },
558 * {
559 * text: '页面次要操作 Disabled',
560 * size: 'default',
561 * type: 'default',
562 * disabled: true,
563 * },
564 * {
565 * text: '警告类操作 Normal',
566 * size: 'default',
567 * type: 'warn'
568 * },
569 * {
570 * text: '警告类操作 Disabled',
571 * size: 'default',
572 * type: 'warn',
573 * disabled: true,
574 * }
575 * ]
576 * }
577 * render () {
578 * return (
579 * <View className='container'>
580 * {this.state.btn.map(item => {
581 * return (
582 * <Button
583 * size={item.size ? item.size : ''}
584 * type={item.type ? item.type : ''}
585 * loading={item.loading ? item.loading : false}
586 * disabled={item.disabled ? item.disabled : false}
587 * >
588 * {item.text}
589 * </Button>
590 * )
591 * })}
592 * <Button className='btn-max-w' plain type='primary'>按钮</Button>
593 * <Button className='btn-max-w' plain type='primary' disabled>不可点击的按钮</Button>
594 * <Button className='btn-max-w' plain >按钮</Button>
595 * <Button className='btn-max-w' plain disabled >按钮</Button>
596 * <Button size='mini' type='primary'>按钮</Button>
597 * <Button size='mini' >按钮</Button>
598 * <Button size='mini' type='warn'>按钮</Button>
599 * <Button openType='getPhoneNumber' onGetPhoneNumber="callback">按钮</Button>
600 * </View>
601 * )
602 * }
603 * }
604 * ```
605 * @example_vue
606 * ```html
607 * <template>
608 * <view class="container">
609 * <button
610 * v-for="item in btn"
611 * :size="item.size ? item.size : ''"
612 * :type="item.type ? item.type : ''"
613 * :loading="item.loading ? item.loading : false"
614 * :disabled="item.disabled ? item.disabled : false"
615 * >
616 * {{ item.text }}
617 * </button>
618 * <button class="btn-max-w" :plain="true" type="primary">按钮</button>
619 * <button class="btn-max-w" :plain="true" type="primary" :disabled="true">不可点击的按钮</button>
620 * <button class="btn-max-w" :plain="true">按钮</button>
621 * <button class="btn-max-w" :plain="true" :disabled="true">按钮</button>
622 * <button size="mini" type="primary">按钮</button>
623 * <button size="mini" >按钮</button>
624 * <button size="mini" type="warn">按钮</button>
625 * <button open-type="getPhoneNumber" `@getphonenumber="callback">按钮</button>
626 * </view>
627 * </template>
628 *
629 * <script>
630 * export default {
631 * data() {
632 * return {
633 * btn: [
634 * {
635 * text: '页面主操作 Normal',
636 * size: 'default',
637 * type: 'primary'
638 * },
639 * {
640 * text: '页面主操作 Loading',
641 * size: 'default',
642 * type: 'primary',
643 * loading: true,
644 * },
645 * {
646 * text: '页面主操作 Disabled',
647 * size: 'default',
648 * type: 'primary',
649 * disabled: true,
650 * },
651 * {
652 * text: '页面次要操作 Normal',
653 * size: 'default',
654 * type: 'default'
655 * },
656 * {
657 * text: '页面次要操作 Disabled',
658 * size: 'default',
659 * type: 'default',
660 * disabled: true,
661 * },
662 * {
663 * text: '警告类操作 Normal',
664 * size: 'default',
665 * type: 'warn'
666 * },
667 * {
668 * text: '警告类操作 Disabled',
669 * size: 'default',
670 * type: 'warn',
671 * disabled: true,
672 * }
673 * ]
674 * }
675 * }
676 * }
677 * </script>
678 * ```
679 * @see https://developers.weixin.qq.com/miniprogram/dev/component/button.html
680 */
681declare const Button: ComponentType<ButtonProps>
682export { Button, ButtonProps }