如何获取showActionSheet中的值 - 微信小程序
发布时间:2022-11-08 12:21:34 246 相关标签: # webkit# 小程序# 数据
<view class="container">
<button type="primary" bindtap="click">按钮</button>
<view>{{value}} </view>
</view>
Page({
/**
* 页面的初始数据
*/
data: {
value: ""
},
click: function() {
var ithis = this;
var list = ['A', 'B', 'C'];
console.log(ithis)
wx.showActionSheet({
itemList: list,
success(res) {
console.log(res.tapIndex)
console.log(res)
console.log(list)
ithis.setData({
value: list[res.tapIndex]
})
},
fail(res) {
console.log(res.errMsg)
}
})
}
})



文章来源: https://blog.51cto.com/u_14233037/5824544
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报