目录

radio

Represents a radio button.

Since: 1.0.0

Attributes

Name Type Default Value Mandatory Description
value string - No ID of the radio component. When a radio is selected, the change event of radio-group will contain this value in its event payload.
checked boolean false No Whether the radio is selected.
disabled boolean false No Whether the component is disabled.
color string #0A59F7 No Color of the radio component, which follows the CSS color attribute.

Example:

HXML file:

<view>
  <view>Default style</view>
  <label class="radio"> <radio value="r1" checked="{{true}}" />Selected</label>
  <label class="radio"> <radio value="r2" />Unselected</label>
</view>