操作反馈action-sheet:官方文档
Demo Code:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
Page({ data: { actionSheetHidden: true, actionSheetItems: ['item1', 'item2', 'item3', 'item4'] }, actionSheetTap: function(e) { this.setData({ actionSheetHidden: !this.data.actionSheetHidden }); }, actionSheetChange:function(e){ this.setData({ actionSheetHidden: !this.data.actionSheetHidden }); }, bindItemTap:function(e){ console.log('tap ' + e.currentTarget.dataset.name); } })
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<button type="default" bindtap="actionSheetTap">弹出action sheet</button> <action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange"> <block wx:for="{{actionSheetItems}}"> <action-sheet-item class="item" bindtap="bindItemTap" data-name="{{item}}">{{item}}</action-sheet-item> </block> <action-sheet-cancel class="cancel">取消</action-sheet-cancel> </action-sheet>
Tip:
开发工具选择的手机型号不同,有的会看不到 取消 选项