微信小程式weui線上入門教程-WeUi操作反饋-actionsheet彈出式選單
阿新 • • 發佈:2019-01-14
效果圖
wxml程式碼
<view class="page"> <view class="page__hd"> <view class="page__title">ActionSheet</view> <view class="page__desc">彈出式選單,採用小程式原生的actionsheet</view> </view> <view class="page__bd"> <view class="weui-btn-area"> <button type="default" bindtap="open">ActionSheet</button> </view> </view> </view>
js程式碼
open: function () {
wx.showActionSheet({
itemList: ['A', 'B', 'C'],
success: function (res) {
if (!res.cancel) {
console.log(res.tapIndex)
}
}
});
},