在vue中使用单选radio
Auteur:neo yang
Tijd:2022/02/06
Lezen: 7196
<label
v-for="(item, i) in radioGroup.items" :key="i">
<input
class=""
type="radio"
:name="radioGroup.field"
v-model="radioGroup.value"
:value="item.key"
/>
{{ item.name }}
</label>
<!--
radioGroup:the json of the radios.
radioGroup.items:the json of every radio item.
radioGroup.field:the field of the radio used.
radioGroup.value:the value of the radioGroup.
item.key:the key of every radio item.
item.name:the name of every radio item.
-->
tags: