PHP专题

【微信小程序开发笔记】如何获取radio选中的value

前端设置value值

<radio-group bindchange="swiperChange">
          <radio name="sex" id="sex" value="男" checked="{{sexname === '男' ? true : false}}">男</radio>
          <radio name="sex" id="sex" value="女" checked="{{sexname === '女' ? true : false}}">女</radio>
</radio-group>

后端获取value值

swiperChange:function(e){
    console.log(e.detail.value)
    this.setData({
      sexname: e.detail.value
    })
},

 

Avatar photo

人生长恨水长东

留言

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据