黄金法则
_handleNewLabelsData(data) {
let options = [];
if (!(data && data.length)) {
return null;
}
data.forEach(item => {
options.push({
value: item.layer,
label: item.name,
id: item.id,
item: {
value: item.layer,
label: item.name
},
children: this._handleNewLabelsData(item.childrenList)
});
});
return options;
},
加班万岁!