varorigin=['home/a/2019-04-09/1.txt','home/a/2019-04-10/2.txt','home/c/2019-04-09/3.txt','home2/d/2019-04-09/4.txt','home2/e/2019-04-09/5.txt'];//輸出varresult=[{label:'home',children:[{label:'a',children:[{label:'2019-04-09',children:...},{label:'2019-04-10',children:...},]},{label:'c',children:...},]},{label:'home2',children:[{label:'b',children:...},{label:'e',children:...}]}]折騰了一晚上實在沒想好怎么搞,求大佬們幫助下我,感謝。
萌新求助,數(shù)組轉(zhuǎn)樹結(jié)構(gòu)
森林海
2019-04-27 22:14:43