下拉框展示数字,可以从数据类型来分析错误, 接收的数据类型是 字符串, 但是value是数字类型
<el-col :span="18">
<el-form-item label="癌种" prop="cancerType" :rules="form.columnId == 2 || form.columnId == 3 ? [{required:true}] : [{required:false}]">
<el-select v-model="form.cancerType" placeholder="请选择" multiple style="width:100%">
<el-option v-for="item in cancerList" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
传的参数和接收的数据类型一致才不会出现错误,所以这里value 值转成了字符串,就可以解决问题
<el-col :span="18">
<el-form-item label="癌种" prop="cancerType" :rules="form.columnId == 2 || form.columnId == 3 ? [{required:true}] : [{required:false}]">
<el-select v-model="form.cancerType" placeholder="请选择" multiple style="width:100%">
<el-option v-for="item in cancerList" :key="item.id" :label="item.title" :value="item.id+''"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>