Quellcode durchsuchen

修改左侧菜单icon-svg传null错误bug

daxiongYang vor 7 Jahren
Ursprung
Commit
bc2df70584
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 2 2
      src/views/main-sidebar-sub-menu.vue
  2. 2 2
      src/views/main.vue

+ 2 - 2
src/views/main-sidebar-sub-menu.vue

4
    :index="menu.menuId + ''"
4
    :index="menu.menuId + ''"
5
    :popper-class="'site-sidebar--' + sidebarLayoutSkin + '-popper'">
5
    :popper-class="'site-sidebar--' + sidebarLayoutSkin + '-popper'">
6
    <template slot="title">
6
    <template slot="title">
7
      <icon-svg :name="menu.icon" class="site-sidebar__menu-icon"></icon-svg>
7
      <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
8
      <span>{{ menu.name }}</span>
8
      <span>{{ menu.name }}</span>
9
    </template>
9
    </template>
10
    <sub-menu
10
    <sub-menu
15
    </sub-menu>
15
    </sub-menu>
16
  </el-submenu>
16
  </el-submenu>
17
  <el-menu-item v-else :index="menu.menuId + ''" @click="gotoRouteHandle(menu)">
17
  <el-menu-item v-else :index="menu.menuId + ''" @click="gotoRouteHandle(menu)">
18
    <icon-svg :name="menu.icon" class="site-sidebar__menu-icon"></icon-svg>
18
    <icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
19
    <span>{{ menu.name }}</span>
19
    <span>{{ menu.name }}</span>
20
  </el-menu-item>
20
  </el-menu-item>
21
</template>
21
</template>

+ 2 - 2
src/views/main.vue

69
        }).then(({data}) => {
69
        }).then(({data}) => {
70
          if (data && data.code === 0) {
70
          if (data && data.code === 0) {
71
            this.loading = false
71
            this.loading = false
72
            this.userId = data.user.userId || ''
73
            this.userName = data.user.username || ''
72
            this.userId = data.user.userId
73
            this.userName = data.user.username
74
          }
74
          }
75
        })
75
        })
76
      }
76
      }