diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index d80e855..322598f 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -116,11 +116,16 @@ function dealMenuText(num,data,list){ break; } } - for (const item of list) { - if ( parData.parentId == 0){ - parData = item - level++ - break; + if(parData.parentId!=0){ + for (const item of list) { + if (parData.parentId == item.id){ + if (item.parentId==0){ + level++ + }else { + level = level+2 + } + break; + } } } if (level==2){ diff --git a/src/views/index.vue b/src/views/index.vue index 43e091e..e8d7ec6 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -5,10 +5,7 @@
-
{{ item.name }}