微信小程序之----弹框组件modal


wxml:

<modal hidden="{{hidden}}" title="这里是title" confirm-text="自定义确定按钮" cancel-text="自定义取消按钮" bindcancel="cancel" bindconfirm="confirm" no-cancel="{{nocancel}}">
    这是对话框的内容。
</modal>


js:

Page({
    data:{
        hidden:false,
        nocancel:false
    },
    cancel: function(){
        this.setData({
             hidden: true
        });
    },
    confirm: function(){
        this.setData({
             nocancel: !this.data.nocancel
        });    
        console.log("clicked confirm");
    }
})  

相关文章:

  • 2021-05-28
  • 2021-04-20
  • 2021-06-03
  • 2021-11-15
  • 2021-11-22
  • 2021-12-30
  • 2021-10-02
猜你喜欢
  • 2021-07-17
  • 2022-12-23
  • 2021-05-08
  • 2021-11-23
  • 2021-12-10
相关资源
相似解决方案