最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序?qū)崿F(xiàn)的點擊按鈕 彈出底部上拉菜單功能示例

 更新時間:2018年12月20日 09:20:14   作者:CoKeny  
這篇文章主要介紹了微信小程序?qū)崿F(xiàn)的點擊按鈕 彈出底部上拉菜單功能,結(jié)合實例形式分析了action-sheet組件及事件響應(yīng)簡單使用技巧,需要的朋友可以參考下

本文實例講述了微信小程序?qū)崿F(xiàn)的點擊按鈕 彈出底部上拉菜單功能。分享給大家供大家參考,具體如下:

index.wxml

<button type="default" bindtap="actionSheetTap">彈出action sheet</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>
<view>
  提示:您選擇了菜單{{menu}}
</view>

index.js

Page({
 data:{
  // text:"這是一個頁面"
  actionSheetHidden:true,
  actionSheetItems:[
   {bindtap:'Menu1',txt:'菜單1'},
   {bindtap:'Menu2',txt:'菜單2'},
   {bindtap:'Menu3',txt:'菜單3'}
  ],
  menu:''
 },
 actionSheetTap:function(){
  this.setData({
   actionSheetHidden:!this.data.actionSheetHidden
  })
 },
 actionSheetbindchange:function(){
  this.setData({
   actionSheetHidden:!this.data.actionSheetHidden
  })
 },
 bindMenu1:function(){
  this.setData({
   menu:1,
   actionSheetHidden:!this.data.actionSheetHidden
  })
 },
 bindMenu2:function(){
  this.setData({
   menu:2,
   actionSheetHidden:!this.data.actionSheetHidden
  })
 },
 bindMenu3:function(){
  this.setData({
   menu:3,
   actionSheetHidden:!this.data.actionSheetHidden
  })
 }
})

運(yùn)行效果(調(diào)試環(huán)境問題,顏色出現(xiàn)了偏差,效果湊合看~):

PS:關(guān)于微信小程序組件相關(guān)說明還可查看微信小程序組件說明表http://tools.jb51.net/table/wx_component

希望本文所述對大家微信小程序開發(fā)有所幫助。

相關(guān)文章

最新評論

巴林左旗| 三原县| 辽宁省| 梧州市| 莱阳市| 高碑店市| 林口县| 融水| 襄汾县| 始兴县| 慈溪市| 聂拉木县| 南部县| 剑阁县| 湘潭市| 楚雄市| 南涧| 长葛市| 饶阳县| 荆州市| 屏东市| 项城市| 乌苏市| 迁西县| 巩留县| 华容县| 佛冈县| 砀山县| 邢台县| 湟中县| 屯门区| 陆川县| 栖霞市| 新竹市| 托克逊县| 横峰县| 穆棱市| 察雅县| 赣榆县| 秦安县| 额济纳旗|