/* tslint:disable */ /** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ export interface Button { /** * 有效值 default, mini(小尺寸)。 */ size?: "default" | "mini"; /** * 按钮的样式类型,有效值 primary、default、warn。 */ type?: "primary" | "default" | "warn"; /** * 是否镂空(ghost 与 plain 等效)。 */ plain?: boolean; /** * 是否禁用。 */ disabled?: boolean; /** * 按钮文字前是否带 loading 图标。 */ loading?: boolean; /** * 按钮按下去的样式类。button-hover 默认为 {background-color: rgba(0, 0, 0, 0.1); opacity: 0.7;},hover-class="none" 时表示没有被点击效果。 */ "hover-class"?: string; /** * 按住后多少时间后出现点击状态,单位毫秒。 */ "hover-start-time"?: number; /** * 手指松开后点击状态保留时间,单位毫秒。 */ "hover-stay-time"?: number; /** * 是否阻止当前元素的祖先元素出现被点击样式。 */ "hover-stop-propagation"?: boolean; /** * 有效值:submit、 reset,用于 form 表单 组件,点击分别会触发 submit/reset 事件。 */ "form-type"?: string; /** * 开放能力。 */ "open-type"?: "share" | "getAuthorize" | "contactShare" | "lifestyle"; /** * 当 open-type 为 getAuthorize 时有效。 */ scope?: "phoneNumber" | "userInfo"; /** * 点击。 * 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。 */ onTap?: () => void; /** * 生活号 id,必须是当前小程序同主体且已关联的生活号,open-type="lifestyle" 时有效。 */ "public-id"?: string; /** * 当 open-type 为 getAuthorize 时有效。 * 当授权成功时触发。 */ onGetAuthorize?: () => void; /** * 当 open-type 为 lifestyle 时有效。 * 当点击按钮时触发。 * event.detail = { followStatus },folllowStatus 合法值有 1、2、3,其中 1 表示已关注。2 表示用户不允许关注。3 表示发生未知错误; * 已知问题:基础库 1.0,当用户在点击按钮前已关注生活号,event.detail.followStatus 的值为 true。 */ onFollowLifestyle?: () => void; /** * 当 open-type 为 getAuthorize 时有效。 * 当授权失败时触发。event.detail = {type, errorMessage},此时 type 的值为 getAuthorize。 */ onError?: () => void; /** * 当 open-type 为 getAuthorize 且 scope 为 userInfo 时有效。 * 当授权成功时触发。 */ onGetUserInfo?: () => void; /** * 当 open-type 为 getAuthorize 且 scope 为 phoneNumber 时有效。 * 当授权成功时触发。 */ onGetPhoneNumber?: () => void; }