<RadioGroup v-model="formData.deficiencyType">
<Radio label="1" :disabled="modalType=='C'?true:false" @click.native="cancelSelection(1)">1</Radio>
<Radio label="2" :disabled="modalType=='C'?true:false" @click.native="cancelSelection(2)">2</Radio>
</RadioGroup>
method:
cancelSelection(selectedLabel) {
if(this.modalType === 'U'){
if (this.formData.deficiencyType == selectedLabel) {
this.formData.deficiencyType = '';
console.log(" this.formData.deficiencyType1: " + this.formData.deficiencyType);
}else{
this.formData.deficiencyType=selectedLabel
}
}
console.log(" this.formData.deficiencyType: " + this.formData.deficiencyType);
},
点击红框中的区域可以取消选中状态
但是点击数字这块区域就不行,
上面方法中 把this.formData.deficiencyType 重置为'',但最后输出打印还是1