Skip to content

Commit 23a9310

Browse files
committed
fix app.updateMenulist when appRouters has more than one item
1 parent bdcd522 commit 23a9310

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

vue/src/store/modules/app.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ class AppModule implements Module<AppState,any>{
6666
updateMenulist (state:AppState) {
6767
let menuList:Array<any> = [];
6868
appRouters.forEach((item, index) => {
69-
if (item.permission !== undefined) {
69+
let itemAny=item as any;
70+
if (itemAny.permission !== undefined) {
7071
let childrenArr = [];
71-
childrenArr = item.children.filter(child => {
72+
childrenArr = itemAny.children.filter(child => {
7273
let childany=child as any;
7374
if (childany.permission !== undefined) {
7475
if(Util.abp.auth.hasPermission(childany.permission)){
@@ -83,12 +84,12 @@ class AppModule implements Module<AppState,any>{
8384
menuList.push(item);
8485
}
8586
} else {
86-
if (item.children.length === 1) {
87+
if (itemAny.children.length === 1) {
8788
menuList.push(item);
8889
} else {
8990
let len = menuList.push(item);
9091
let childrenArr = [];
91-
childrenArr = item.children.filter(child => {
92+
childrenArr = itemAny.children.filter(child => {
9293
return child;
9394
});
9495
let handledItem = JSON.parse(JSON.stringify(menuList[len - 1]));

0 commit comments

Comments
 (0)