<input type
="checkbox" v
-model
="nids" :value
="news.nid"/>{{news
.nid
}}
<input type
="checkbox" v
-on
:click
="checkAll()"> 全选
checkAll
:function(){
var _this
=this;
this.newsMessage
.forEach(function
(item
,index
) {
if(_this
.nids
.indexOf(item
.nid
)==-1){
_this
.nids
.push(item
.nid
);
}else {
var ukey
= _this
.nids
.indexOf(item
.nid
);
_this
.nids
.splice(ukey
,1);
}
})
},
转载请注明原文地址: https://mac.8miu.com/read-505271.html