今天就跟大家聊聊有關(guān)怎么在微信小程序利用modal彈出框?qū)崿F(xiàn)一個遮罩層組件,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
js
Page({ data: { hiddenModal1:true, hiddenModal2:true, input:null }, showModal1:function(e){ this.setData({hiddenModal1:false}) }, model1confirm:function(e){ this.setData({ hiddenModal1: true }) wx.showToast({ title: '我覺得OK', }) }, model1cancel:function(e){ this.setData({ hiddenModal1: true }) wx.showToast({ title: '我覺得不行', }) }, input:function(e){ this.setData({input:e.detail.value}) }, showModal2: function (e) { this.setData({ hiddenModal2: false }) }, model2confirm: function (e) { this.setData({ hiddenModal2: true }) wx.showToast({ title: '確定' +this.data.input, icon:'none' }) }, model2cancel: function (e) { this.setData({ hiddenModal2: true }) wx.showToast({ title: '取消'+this.data.input, icon: 'none' }) } })
wxml
modal是真的好用
看完上述內(nèi)容,你們對怎么在微信小程序利用modal彈出框?qū)崿F(xiàn)一個遮罩層組件有進(jìn)一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。