• 微信小程序中自定义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");
}
})

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2021-11-23
  • 2021-05-01
  • 2022-01-06
猜你喜欢
  • 2021-05-08
  • 2021-05-25
  • 2021-07-21
  • 2021-08-10
  • 2021-12-12
  • 2022-02-07
  • 2022-02-25
相关资源
相似解决方案