uni.showActionSheetuni
从底部向上弹出操作菜单
uni.showActionSheet({
itemList: ['A', 'B', 'C'],
success: function (res) {
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
},
fail: function (res) {
console.log(res.errMsg);
}
});
一.OBJECT参数
参数 | 类型 | 说明 |
---|
itemList | Array | 按钮的文字数组 |
itemColor | HexColor | 按钮的文字颜色,字符串格式,默认为"#000000" |
popover | Object | 大屏设备弹出原生选择按钮框的指示区域,默认居中显示 |
success | Function | 接口调用成功的回调函数,详见返回参数说明 |
fail | Function | 接口调用失败的回调函数 |
complete | Function | 接口调用结束的回调函数(调用成功、失败都会执行) |
二.popover值
值 | 类型 | 说明 |
---|
top | Number | 指示区域坐标,使用原生 navigationBar 时一般需要加上 navigationBar 的高度 |
left | Number | 指示区域坐标 |
width | Number | 指示区域宽度 |
height | Number | 指示区域高度 |
三.success返回参数
参数 | 类型 | 说明 |
---|
tapIndex | Number | 用户点击的按钮,从上到下的顺序,从0开始 |