小程序开放平台

文档中心
表单组件
button
checkbox
checkbox-group
editor
form
input
label
picker
picker-view
picker-view-column
radio
radio-group
slider
switch
textarea
基础内容
媒体组件
地图
视图容器
导航组件
开放能力
画布

radio

开发
>
组件
>
表单组件
>
radio
>
更新时间:2025-04-10 15:29:55

radio

单选项目。

属性
类型
默认值
必填
说明
valuestringradio 标识。当该radio 选中时,radio-group 的 change 事件会携带radio的value
checkedbooleanfalse当前是否选中
disabledbooleanfalse是否禁用
colorstring#09BB07radio的颜色,同css的color

扫码预览

组件示例

  <view class="page-body">
    <view class="page-section">
      <view class="page-section-title">radioGroup2</view>
      <view class="weui-cells weui-cells_after-title">
        <view>当前选择value: {{curValue2}}</view>
        <radio-group bindchange="radioChange2">
          <label class="weui-cell weui-check__label" xhs:for="{{items2}}" xhs:key="{{item.value}}">
            <view class="weui-cell__hd">
              <radio value="{{item.value}}" checked="{{item.checked}}" disabled="{{false}}" color="#F85959"/>
            </view>
            <view class="weui-cell__bd">{{item.name}}</view>
          </label>
        </radio-group>
      </view>
    </view>
  </view>

该文档是否对您有帮助?