> 你可以更改/public/admin/controller/apiconfig.js配置文件里默认的菜单接口来实现调用动态添加的菜单数据。 ## 菜单数据结构 ~~~ { "data":[ { "id":1, "title":"首页", "path":"#/", "icon":"", "pid":0, "open":false, "children":[] },{ "id":2, "title":"设置", "path":"", "icon":"", "pid":0, "open":false, "children":[{ "id":3, "title":"个人", "path":"", "icon":"", "pid":2, "open":false, "children":[{ "id":8, "title":"安全", "path":"", "icon":"", "pid":3, "open":false, "children":[{ "id":9, "title":"更改密码", "path":"#/admin/editPwd", "icon":"", "pid":8, "open":false, "children":[] }] }] },{ "id":10, "title":"系统", "path":"", "icon":"", "pid":2, "open":false, "children":[{ "id":11, "title":"系统配置", "path":"#/system/system", "icon":"", "pid":10, "open":false, "children":[] },{ "id":12, "title":"权限节点", "path":"#/system/rule", "icon":"", "pid":10, "open":false, "children":[] }] }] },{ "id":4, "title":"用户", "path":"", "icon":"", "pid":0, "open":false, "children":[{ "id":5, "title":"管理组", "path":"#/admin/index", "icon":"", "pid":4, "open":false, "children":[] },{ "id":19, "title":"用户组", "path":"#/user/index", "icon":"", "pid":4, "open":false, "children":[] }] },{ "id":13, "title":"门户", "path":"", "icon":"", "pid":0, "open":false, "children":[{ "id":19, "title":"菜单管理", "path":"#/portal/menu", "icon":"", "pid":13, "open":false, "children":[] },{ "id":18, "title":"轮播组图", "path":"#/portal/carousel", "icon":"", "pid":13, "open":false, "children":[] },{ "id":14, "title":"内容管理", "path":"", "icon":"", "pid":13, "open":false, "children":[{ "id":15, "title":"分类管理", "path":"#/portal/contentCate", "icon":"", "pid":14, "open":false, "children":[] },{ "id":16, "title":"文章/商品", "path":"#/portal/content", "icon":"", "pid":14, "open":false, "children":[] }] },{ "id":17, "title":"评论/留言", "path":"#/user/message", "icon":"", "pid":13, "open":false, "children":[] }] },{ "id":6, "title":"回收站", "path":"", "icon":"", "pid":0, "open":false, "children":[{ "id":7, "title":"回收站", "path":"#/recycling/index", "icon":"", "pid":6, "open":false, "children":[] }] } ] } ~~~ 以上是系统默认的菜单数据,不难看出这其实是一个标准的json数据结构。 ### 菜单的字段说明 ![](https://box.kancloud.cn/f628b876caa95fca754f811499f56d5d_1138x335.png) 其中,path字段的值为#/开头,后面则是views目录下的结构,比如#/admin/index,其实访问的则是views/admin/index.html文件 icon字段目前只支持layui的图标。 > **注意:菜单最多支持到4级。**