小程序弹出框
<!--pages/index24/index24.wxml-->
<button type="default" bindtap="actionSheetTap">{{yuan}}{{menu}}</button>
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetbindchange">
<block wx:for-items="{{actionSheetItems}}">
<action-sheet-item bindtap="bind{{item.bindtap}}">{{item.txt}}</action-sheet-item>
</block>
<action-sheet-cancel class="cancel">取消</action-sheet-cancel>
</action-sheet>
// pages/index24/index24.js
Page({
data: {
// text:"这是一个页面"
yuan:'女',
actionSheetHidden: true,
actionSheetItems: [
{ bindtap: 'Menu1', txt: '男' },
{ bindtap: 'Menu2', txt: '女' },
],
menu: ''
},
actionSheetTap: function () {
this.setData({
actionSheetHidden: !this.data.actionSheetHidden
})
},
actionSheetbindchange: function () {
this.setData({
actionSheetHidden: !this.data.actionSheetHidden
})
},
bindMenu1: function () {
this.setData({
yuan:'',
menu: '男',
actionSheetHidden: !this.data.actionSheetHidden
})
},
bindMenu2: function () {
this.setData({
yuan: '',
menu: '女',
actionSheetHidden: !this.data.actionSheetHidden
})
},
})
不求大富大贵,但求一生平凡