前言
不知道大家有没有发现,在网上很多树状插件都是需要固定格式的Json,但自己在生成Json的时候没考虑这些,所以就只能自己拼接字符串来生成无序列表.
比如:
菜单1":[
{
"domain":"顶层菜单1","runType":"background","moduleName":"子菜单","memo":"描述","srcFile":"","depends":[]
}
],"顶层菜单2":[
{
"domain":"顶层菜单2","moduleName":"子菜单1","depends":[]
},{
"domain":"顶层菜单2","moduleName":"子菜单2","顶层菜单3":[]
}
直接贴代码吧…
' + n + '
- '+ moduleName + ''+ '';
}
html += '