
<div>
<el-checkbox-group v-model="selectProductAttr[idx].values">
<div v-for="(item,index) in selectProductAttr[idx].options" style="display: inline-block"
class="littleMarginLeft">
<el-checkbox :label="item" :key="item"></el-checkbox>
<el-button type="text" class="littleMarginLeft" @click="handleRemoveProductAttrValue(idx,index)">删除
</el-button>
</div>
</el-checkbox-group>
<el-input v-model.trim="addProductAttrValue" style="width: 160px;margin-left: 10px" clearable></el-input>
<el-button class="littleMarginLeft" @click="handleAddProductAttrValue(idx)">增加</el-button>
</div>
handleAddProductAttrValue(idx){
if(this.addProductAttrValue==null || this.addProductAttrValue==''){
this.$message.warning("属性值不能为空")
}else if(this.selectProductAttr[idx].options.indexOf(this.addProductAttrValue)!== -1){
this.$message.warning("属性值不能重复")
}else {
this.selectProductAttr[idx].options.push(this.addProductAttrValue);
this.addProductAttrValue='';
}
},
handleRemoveProductAttrValue(idx,index){
this.selectProductAttr[idx].options.splice(index,1)
},