问题
I have a object of object of object ... i have a tree !
i use this jade code for display my tree :
mixin file_list(files)
ul
each file, i in files
li #{file.id}
if file.children.length > 0
mixin file_list(file.children)
but the result is:
<ul>
<li></li>
<ul>
<li></li>
</ul>
</ul>
i need :
<ul>
<li>
<ul>
<li></li>
</ul>
</li>
</ul>
回答1:
mixin file_list(files)
ul
each file, i in files
li #{file.id}
if file.children.length > 0
mixin file_list(file.children)
来源:https://stackoverflow.com/questions/18483956/ul-in-li-tree-display-with-jade