pickReason(){
let list = this.reasonList.map(item => {
return item.reasonTitle
})
wx.showActionSheet({
itemList: list,
success: (res) => {
this.reasonStr = list[res.tapIndex]
this.reasonId = this.reasonList[res.tapIndex].resReId
},
fail (res) {
console.log(res.errMsg)
}
});
console.log(list)
},
平时是不用fail的,这次加了fail,才发现提示错误:
showActionSheet:fail parameter error: itemList should not be large than 6
截图如下:
原来wx.showActionSheet最多只能支持六个选项,而我这里的list数组有七条。所以最后改成了pick选择器