微信小程序点击显示某个view

<view bindtap='showButton'>点击</view>

<view class="Mask {{MaskView?'hide':'show'}}">受控制的view</view>
data: {
    MaskView: true,
  },

showButton: function () {
    var that = this;
    that.setData({
      MaskView: (!that.data.MaskView)
    })
  },

猜你喜欢

转载自www.cnblogs.com/yyy251/p/12218113.html