Browse Source

修改菜单点击调转bug

asd123a20 1 year ago
parent
commit
aa0167a8ce
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/components/heads/nav/index.vue

+ 2 - 1
src/components/heads/nav/index.vue

@@ -44,8 +44,9 @@ export default {
     async handleSelect(env) {
       // 获取最后一级菜单
       const last = await this.setactiveIndex(env);
+      console.log(env, 'env');
       // 赋值当前选选个
-      this.activeIndex = last?.code == 'ztjy' ? env.children[1].code : last?.code;
+      this.activeIndex = (last?.code == 'ztjy' && env.children) ? env.children[1].code : last?.code;
       // 缓存写入当前一例菜单
       this.$setParentsetSession({ menus: this.menusalls, iscode: last });
       // 写入当前菜单编码