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(ith
<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)
}
})
}
})