<el-checkbox-group v-model="checkList" @change="changeList">
<el-checkbox
:disabled="item.disabled"
:label="item.name"
v-for="item in list"
:key="item.name"
></el-checkbox>
</el-checkbox-group>
data(){return{
checkList: [],
list: [
{ disabled: false, name: "GJB5000" },
{ disabled: false, name: "GJB9001" },
{ disabled: false, name: "CMMI" },
{ disabled: false, name: "合同未指定" },
],
}}
changeList(val) {
this.list.forEach((item) => {
item.disabled = false;
});
if (val.indexOf("合同未指定") != -1) {
this.checkList = ["合同未指定"];
this.list.forEach((item) => {
if (item.name != "合同未指定") {
item.disabled = true;
}
});
}
},