设置v-model : v-model="radioIndex[index]"
<RadioGroup v-for="(item, index) in indexList" :key="index" v-model="radioIndex[index]" @on-change="changeIndex" > <div>{{ item.FD_TYPE }}</div> <Radio v-for="it in item.FD_INDEX" :label="it.FD_ID" :key="it.FD_ID" > <label>{{ it.FD_INDEX }}</label> </Radio> </RadioGroup>
获取时记得去重删除数组中的empty
// 获取选中的值 changeIndex() { this.indexSelect = this.radioIndex.filter(currentValue => currentValue !== ''); },
本文作者为gengboxb,转载请注明。