uni.showActionSheet(OBJECT)

​显示操作菜单

OBJECT参数说明

参数 类型 必填 说明 平台支持
itemList String Array 按钮的文字数组,数组长度最大为6个 all
itemColor HexColor 按钮的文字颜色,默认为"#000000" all
success Function 接口调用成功的回调函数,详见返回参数说明 all
fail Function 接口调用失败的回调函数 all
complete Function 接口调用结束的回调函数(调用成功、失败都会执行) all

success返回参数说明

参数 类型 说明 平台支持
tapIndex Number 用户点击的按钮,从上到下的顺序,从0开始 all

示例

uni.showActionSheet({
  itemList: ['A', 'B', 'C'],
  success: function(res) {
    console.log(res.tapIndex)
  },
  fail: function(res) {
    console.log(res.errMsg)
  }
})

results matching ""

    No results matching ""