{
  "title": "button",
  "type": "object",
  "properties": {
    "size": {
      "type": "string",
      "description": "大小",
      "defaultValue": "default",
      "enum": [
        "default",
        "mini"
      ]
    },
    "type": {
      "type": "string",
      "description": "类型",
      "defaultValue": "default",
      "enum": [
        "primary",
        "default",
        "warn"
      ]
    },
    "plain": {
      "type": "boolean",
      "description": "按钮是否镂空，背景色透明",
      "defaultValue": false
    },
    "form-type": {
      "type": "string",
      "description": "用于<form>组件，点击分别会触发<form>组件的 submit/reset 事件",
      "defaultValue": "buttonclick",
      "enum": [
        "buttonclick",
        "submit",
        "reset"
      ]
    },
    "open-type": {
      "type": "string",
      "description": "百度 App 开放能力，比如分享、获取用户信息等等",
      "enum": [
        "share",
        "getUserInfo",
        "getPhoneNumber",
        "openSetting",
        "chooseAddress",
        "chooseInvoiceTitle",
        "contact",
        "login",
        "subscribe"
      ]
    },
    "hover-class": {
      "type": "string",
      "description": "点击态。指定按钮按下去的样式类。当hover-class=\"none\"时，没有点击态效果。button-hover 默认为{background-color: rgba(0, 0, 0, 0.1); opacity: 0.7;}",
      "defaultValue": "button-hover"
    },
    "hover-stop-propagation": {
      "type": "boolean",
      "description": "指定是否阻止本节点的祖先节点出现点击态",
      "defaultValue": false
    },
    "hover-start-time": {
      "type": "number",
      "description": "按住后多久出现点击态（单位：毫秒）",
      "defaultValue": 20
    },
    "hover-stay-time": {
      "type": "number",
      "description": "手指松开后点击态保留时间（单位：毫秒）",
      "defaultValue": 70
    },
    "disabled": {
      "type": "boolean",
      "description": "是否禁用",
      "defaultValue": false
    },
    "loading": {
      "type": "boolean",
      "description": "名称前是否带有 loading 图标",
      "defaultValue": false
    },
    "session-from": {
      "type": "string",
      "description": "会话来源，open-type=\"contact\" 时有效"
    },
    "send-message-title": {
      "type": "string",
      "description": "会话内消息卡片标题，open-type=\"contact\" 时有效",
      "defaultValue": "当前标题"
    },
    "send-message-path": {
      "type": "string",
      "description": "会话内消息卡片点击跳转小程序路径，open-type=\"contact\" 时有效",
      "defaultValue": "当前页面路径"
    },
    "send-message-img": {
      "type": "string",
      "description": "会话内消息卡片图片，open-type=\"contact\" 时有效",
      "defaultValue": "默认图片"
    },
    "show-message-card": {
      "type": "boolean",
      "description": "是否显示会话内消息卡片，设置此参数为 true，用户进入客服会话会在右下角显示\"可能要发送的小程序\"提示，用户点击后可以快速发送小程序消息，open-type=\"contact\" 时有效",
      "defaultValue": false
    },
    "template-id": {
      "type": [
        "string",
        "Array.<string>"
      ],
      "description": "发送订阅类模板消息所用的模板库标题 ID ，可通过 getTemplateLibraryList 获取\n当参数类型为 Array 时，可传递 1~3 个模板库标题 ID"
    },
    "subscribe-id": {
      "type": "string",
      "description": "发送订阅类模板消息时所使用的唯一标识符，内容由开发者自定义，用来标识订阅场景\n注意：同一用户在同一 subscribe-id 下的多次授权不累积下发权限，只能下发一条。若要订阅多条，需要不同 subscribe-id"
    },
    "bindGetPhoneNumber": {
      "tsType": "() => void",
      "description": "获取用户手机号回调。和 open-type 搭配使用， 使用时机：open-type=\"getPhoneNumber\"。具体申请方法请见：获取用户手机号权限申请"
    },
    "bindGetUserInfo": {
      "tsType": "() => void",
      "description": "用户点击该按钮时，会返回获取到的用户信息，可以从返回参数的 detail 中获取到的值。当 errMsg 为getUserInfo:ok时即为获取成功；其中 userInfo 字段中包含获取到的用户头像地址（avatarUrl）、性别（gender）、昵称（nickName）。和 open-type 搭配使用， 使用时机：open-type=\"getUserInfo\""
    },
    "bindOpenSetting": {
      "tsType": "() => void",
      "description": "在打开授权设置页后回调，使用时机：open-type=\"openSetting\""
    },
    "bindContact": {
      "tsType": "() => void",
      "description": "客服消息回调，使用时机：open-type=\"contact\""
    },
    "bindChooseAddress": {
      "tsType": "() => void",
      "description": "用户点击该按钮时，调起用户编辑收货地址原生界面，并在编辑完成后返回用户选择的地址，从返回参数的 detail 中获取，和 swan.chooseAddress 一样的。和 open-type 搭配使用，使用时机：open-type=\"chooseAddress\""
    },
    "bindChooseInvoiceTitle": {
      "tsType": "() => void",
      "description": "用户点击该按钮时，选择用户的发票抬头，和 swan.chooseInvoiceTitle 一样的。和 open-type 搭配使用，使用时机：open-type=\"chooseInvoiceTitle\""
    },
    "bindLogin": {
      "tsType": "() => void",
      "description": "登录回调，和 open-type 搭配使用，使用时机：open-type=\"login\"。可以通过返回参数的 detail 判断是否登录成功，当 errMsg 为'login:ok'时即为成功。如想获取登录凭证请使用 swan.getLoginCode"
    },
    "bindSubscribe": {
      "tsType": "() => void",
      "description": "订阅消息授权回调，和 open-type 搭配使用，使用时机：open-type=\"subscribe\""
    }
  },
  "additionalProperties": false
}