this.treeData = list.reduce((cur, next) => {
obj[next.title] ? '' : (obj[next.title] = true && cur.push(next))
return cur
}, [])
得到this.treeData就是去重过的数组。
this.treeData = list.reduce((cur, next) => {
obj[next.title] ? '' : (obj[next.title] = true && cur.push(next))
return cur
}, [])
得到this.treeData就是去重过的数组。