<div v-for="subject in subjects" v-bind:class="classObject" >{{subject.question}}
<input type="radio" id="a" value="a" name="forradio" v-on:click="check_question">
<label for="a">{{subject.answer_a}}</label>
<input type="radio" id="b" value="b" name="forradio" v-on:click="check_question">
<label for="b">{{subject.answer_b}}</label>
<input type="radio" id="c" value="c" name="forradio" v-on:click="check_question">
<label for="c">{{subject.answer_c}}</label>
<input type="radio" id="d" value="d" name="forradio" v-on:click="check_question">
<label for="d">{{subject.answer_d}}</label>
</div>這樣不行,會導致所有單選只能選擇一個
vuejs怎么實現v-for中的單選按鈕
MMTTMM
2018-10-12 19:14:37