this.Num.forEach(item=>{
if (this.Group.length>0) {
this.Group.find(key=>key.id===item.id? '':item)
this.Group.push(item)
}else {
this.Group.push(item)
}
})
Num要遍历,然后匹配Group中找到不一样的key,在push到group里形成一个新数组。
搞那么复杂干嘛,换成这样写不好吗