vue <el-checkbox-group>多选框回显
vue多选框回显问题
·
页面
<el-form-item label="采购类型:" prop="purchasingType">
<el-checkbox-group v-model="dataForm.purchasingType">
<el-checkbox
v-for="item in codeItems.purchasingTypeList"
:key="item.itemValue"
:label="item.itemValue"
:value="item.itemValue">{{item.itemText}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
data(){
dataForm:{
purchasingType:[1,2] //这样就能回显选项1和选项2的数据了,绑定的是一个数组
}
codeItems:[
purchasingTypeList:[{itemValue:1,itemText:"选项1"},{itemValue:2,itemText:"选项2"}]
],
}
更多推荐



所有评论(0)