数据结构,"menuName": "一级菜单1",菜单名称,效果图上不了,要申请博客了,
这是一个树形的数据,我要实现的是菜单的层级关系,初始化是一级菜单,点击一级菜单二级菜单显示,以此类推。效果出来了,就是不会加动画,需要点动画,下面是我的代码
login.list.list就数下面的list集合!
实现的效果大体是
一级菜单
二级菜单
一级菜单
二级菜单
<li ng-repeat="x in login.list.list">
<div ng-class="x.orders==id?'tabLevel11':'tabLevel1'" ng-click="num=!num">
<img class="tabImg" src="{{x.menuIcon}}">
<a>{{x.menuName}}</a>
</div>
<div ng-click="bb($index+1)" class="tabLevel2" ng-if="num" ng-repeat="y in x.sonMenu">
<img class="tabImg1" src="{{y.menuIcon}}">
<a href="#/commercialList.html">{{y.menuName}}</a>
<div ng-repeat="z in y.sonMenu" ng-if="y.orders==id1">
{{z.menuName}}
</div>
</div>
</li>
{
"list": [{
"buttonIdValue": "",
"createTime": null,
"createUid": 0,
"id": 0,
"menuCss": "",
"menuIcon": "icon-settings",
"menuLevel": 1,
"menuName": "一级菜单1",
"menuType": 1,
"menuUrl": "javascript:void(0)",
"orders": 1,
"pid": 0,
"sonMenu": [{
"buttonIdValue": "",
"createTime": null,
"createUid": 0,
"id": 0,
"menuCss": "",
"menuIcon": "icon-settings",
"menuLevel": 2,
"menuName": "城市代码",
"menuType": 1,
"menuUrl": "CityArea.html",
"orders": 2,
"pid": 0,
"sonMenu": [{
"buttonIdValue": "edit",
"createTime": null,
"createUid": 0,
"id": 0,
"menuCss": "",
"menuIcon": "icon-settings",
"menuLevel": 0,
"menuName": "编辑",
"menuType": 2,
"menuUrl": "",
"orders": 1,
"pid": 0,
"sonMenu": [],
"sysFlag": "YUNYING"
}],
"sysFlag": "YUNYING"
}, {
"buttonIdValue": "",
"createTime": null,
"createUid": 0,
"id": 0,
"menuCss": "",
"menuIcon": "icon-settings",
"menuLevel": 2,
"menuName": "业务字典",
"menuType": 1,
"menuUrl": "Dictionary.html",
"orders": 1,
"pid": 0,
"sonMenu": [],
"sysFlag": "YUNYING"
}],
"sysFlag": "YUNYING"
}, {
"buttonIdValue": "",
"createTime": null,
"createUid": 0,
"id": 0,
"menuCss": "",
"menuIcon": "icon-settings",
"menuLevel": 1,
"menuName": "一级菜单2",
"menuType": 1,
"menuUrl": "javascript:void(0)",
"orders": 2,
"pid": 0,
"sonMenu": [{
"buttonIdValue": "",
"createTime": null,
"createUid": 0,
"id": 0,
"menuCss": "",
"menuIcon": "icon-settings",
"menuLevel": 2,
"menuName": "二级菜单1",
"menuType": 1,
"menuUrl": "javascript:void(0)",
"orders": 1,
"pid": 0,
"sonMenu": [{
"buttonIdValue": "",
"createTime": null,
"createUid": 0,
"id": 0,
"menuCss": "",
"menuIcon": "icon-settings",
"menuLevel": 3,
"menuName": "三级菜单1",
"menuType": 1,
"menuUrl": "javascript:void(0)",
"orders": 1,
"pid": 0,
"sonMenu": [],
"sysFlag": "YUNYING"
}],
"sysFlag": "YUNYING"
}],
"sysFlag": "YUNYING"
}]