登录

在vue中使用单选radio

作者:neo yang 时间:2022/02/06 读: 7420
<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.

-->
标签:


copyright © www.lyustu.com all rights reserve.
Theme: TheMoon V3.0. Author:neo yang