<input type="checkbox" v-model="nids" :value="news.nid"/>{{news.nid}}
<input type="checkbox" v-on:click="checkAll()"> 全选
checkAll:function(){
// alert(3);
var _this=this;
this.newsMessage.forEach(function (item,index) {
//alert(1);
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);
}
})
},