49 lines
1.3 KiB
Plaintext

<demo-block title="基本用法" padding>
<van-radio-group
value="{{ radio1 }}"
data-key="radio1"
custom-class="demo-radio-group"
bind:change="onChange"
>
<van-radio name="1" custom-class="demo-radio">单选框 1</van-radio>
<van-radio name="2" custom-class="demo-radio">单选框 2</van-radio>
</van-radio-group>
</demo-block>
<demo-block title="禁用状态" padding>
<van-radio-group
disabled
value="{{ radio2 }}"
data-key="radio2"
custom-class="demo-radio-group"
bind:change="onChange"
>
<van-radio name="1" custom-class="demo-radio">单选框 1</van-radio>
<van-radio name="2" custom-class="demo-radio">单选框 2</van-radio>
</van-radio-group>
</demo-block>
<demo-block title="自定义颜色" padding>
<van-radio
name="1"
value="1"
custom-class="demo-radio"
checked-color="#07c160"
>
单选框
</van-radio>
</demo-block>
<demo-block title="与 Cell 组件一起使用">
<van-radio-group value="{{ radio3 }}">
<van-cell-group>
<van-cell title="单选框 1" clickable data-value="1" bind:click="onClick">
<van-radio name="1" />
</van-cell>
<van-cell title="单选框 2" clickable data-value="2" bind:click="onClick">
<van-radio name="2" />
</van-cell>
</van-cell-group>
</van-radio-group>
</demo-block>