文章目录
一. radio 与 radio-group
- 一. radio 与 radio-group
- 二 .代码示例
radio 为表单组件中的单选,适用于只能选择一个值的场景. radio 的常用属性如下: radio-group 为单项选择器,内部由多个 组成。 其属性如下, 为bindchange, 当其内部的radio的值发生改变时, 触发该事件.
wxml的代码如下. 使用wx:for
来进行循环遍历出数组中的值 . 并对radio中的color等属性,进行动态的赋值. 并使用了bindchange属性,进行单选值绑定的监听.
关注
打赏