- 如果后台返回的单选框的值是number:单选框的lable需要设置成 :lable=‘0’;如下:
<el-form-item label="仿牌选项:" prop="ifCod" size="mini" class='form-label'>
<div id='radio' >
<el-radio class='m0' :disabled="disable" v-model="form.ifCod" :label="0" >普货</el-radio>
<el-radio class='m0' :disabled="disable" v-model="form.ifCod" :label="1" >仿牌</el-radio>
</div>
</el-form-item>
data(){
return {
form:{
ifCode:0
}
}
}
- 后台返回的是字符串 则正常写;
<el-form-item label="仿牌选项:" prop="ifCod" size="mini" class='form-label'>
<div id='radio' >
<el-radio class='m0' :disabled="disable" v-model="form.ifCod" label="0" >普货</el-radio>
<el-radio class='m0' :disabled="disable" v-model="form.ifCod" label="1" >仿牌</el-radio>
</div>
</el-form-item>
data(){
return {
form:{
ifCode:'0'
}
}
}
来源:CSDN
作者:Reborn angel
链接:https://blog.csdn.net/zyqgt960812/article/details/104773882