微信小程序radio再次点击取消

微信小程序实现radio点击选中,再次点击取消选中

js中:

page({
  data: {
    check:true,
   
  },
radiocon: function (e) {
    var check = this.data.check;
      check=!check;
    
    this.setData({
      check: check
    })
  },
})

wxml中:

 <radio  checked='{{check}}'  bindtap='radiocon'></radio>

猜你喜欢

转载自blog.csdn.net/qq_39404258/article/details/89474764
今日推荐