需求 假设有一个map,数据结构如下 { 哈尔滨: ['哈尔滨1', '哈尔滨2'], 天津: ['天津1', '天津2'], } 想把它转变为树状格式,该如何做: [ { "id": 1, "label": "哈尔滨", "children": [ { "id": 3, "label": "哈尔滨1" }, { "id": 4, "label": "哈尔滨2" } ] }, { "id": 2, "label": "天津", "children"