老师讲的全选和取消全选 上面列表根本不起作用
checkAll:function (flag) {
this.checkAllFlag = flag;
var _this = this;
this.productlist.forEach(function(item,index){
if(typeof item.checked == 'undefined'){
_this.$set(item,'checked',_this.checkAllFlag);
}else{
item.checked = _this.checkAllFlag;
}
})
}