typescript將簡單對象數組轉換成父子結構(具備children屬性)的對象

轉換效果 initDat=[ { title: '節點1', pkey: '-1', key: '2', }, { title: '節點2', pkey: '2', key: 'test1', }, { title: '節點3', pkey: '2', key: 'test2', } ] 轉換爲: da
相關文章
相關標籤/搜索