页面

<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"}]

],

}

Logo

前往低代码交流专区

更多推荐