liaolongjun

微信小程序弹出操作菜单

 

比如在页面上放一个按钮,点击按钮弹出操作菜单,那么在按钮的 bindtap 事件里,执行下面的代码即可:

 

wx.showActionSheet({
  itemList: [\'A\', \'B\', \'C\'],
  success: function (res) {
    console.log(JSON.stringify(res))
    console.log(res.tapIndex) // 用户点击的按钮,从上到下的顺序,从0开始
  },
  fail: function (res) {
    console.log(res.errMsg)
  }
})

  

分类:

技术点:

相关文章:

  • 2021-10-01
  • 2021-10-01
  • 2021-11-02
  • 2021-12-20
  • 2022-12-23
  • 2021-10-01
  • 2021-12-20
  • 2021-12-10
猜你喜欢
  • 2021-11-03
  • 2021-10-08
  • 2021-10-19
  • 2021-09-02
  • 2021-08-03
  • 2021-12-20
  • 2021-05-28
相关资源
相似解决方案