微信小程序 action-sheet詳解及實例代碼
更新時間:2016年11月09日 10:44:59 投稿:lqh
這篇文章主要介紹了微信小程序 action-sheet詳解及實例代碼的相關(guān)資料,需要的朋友可以參考下
微信小程序 開發(fā)文檔,相關(guān)文章:
微信小程序 action-sheet
| 屬性名 | 類型 | 默認(rèn)值 | 說明 |
|---|---|---|---|
| hidden | Boolean | true | 是否隱藏 |
| bindchange | EventHandle | 點擊背景或action-sheet-cancel按鈕時觸發(fā)change事件,不攜帶數(shù)據(jù) |
action-sheet-item
底部菜單表的子選項。
action-sheet-cancel
底部菜單表的取消按鈕,和action-sheet-item的區(qū)別是,點擊它會觸發(fā)action-sheet的change事件,并且外觀上會同它上面的內(nèi)容間隔開來。
示例代碼:
<button type="default" bindtap="actionSheetTap">彈出action sheet</button>
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange">
<block wx:for-items="{{actionSheetItems}}">
<action-sheet-item class="item" bindtap="bind{{item}}">{{item}}</action-sheet-item>
</block>
<action-sheet-cancel class="cancel">取消</action-sheet-cancel>
</action-sheet>
var items = ['item1', 'item2', 'item3', 'item4']
var pageObject = {
data: {
actionSheetHidden: true,
actionSheetItems: items
},
actionSheetTap: function(e) {
this.setData({
actionSheetHidden: !this.data.actionSheetHidden
})
},
actionSheetChange: function(e) {
this.setData({
actionSheetHidden: !this.data.actionSheetHidden
})
}
}
for (var i = 0; i < items.length; ++i) {
(function(itemName) {
pageObject['bind' + itemName] = function(e) {
console.log('click' + itemName, e)
}
})(items[i])
}
Page(pageObject)
action-sheet

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
微信小程序 POST請求(網(wǎng)絡(luò)請求)詳解及實例代碼
這篇文章主要介紹了微信小程序 POST請求(網(wǎng)絡(luò)請求)詳解及實例代碼的相關(guān)資料,需要的朋友可以參考下
2016-11-11 
