<div style="margin-left:20px;">
<el-checkbox
v-for="item in SigningcheckList"
:key="item.index"
:label="item.ele"
v-model="item.status"
@change="SigningChangeitem(item)"
></el-checkbox>
</div>
// 当checkbox的值发生改变的时候
SigningChangeitem(val) {
// 判断当前传过来元素的值是否是选中状态
if (val.status == true) {
this.SigningContent.push(val.ele);
} else {
//或者循环遍历数组删除选中元素
for (let i = 0; i < this.SigningContent.length; i++) {
const element = this.SigningContent[i];
if (element == val.ele) {
this.SigningContent.splice(i, 1);
}
}
}
网友评论