1 回复
Wxml:
<view wx:if=’{{!hiddenView}}’>要隐藏的</view>
<button bindtap=‘showMyModal’>打开弹窗</button>
Js:
data: {
//hiddenView初始为假
hiddenView: false
},
showMyModal(){
var that = this
wx.showModal({
title: ‘标题’,
content: ‘内容’,
success: function(res) {
//如果是点击的确定,设置hiddenView为真
if(res.confirm){
that.setData({
hiddenView : true
})
}
},
fail: function(res) {},
complete: function(res) {},
})
},