Selaa lähdekoodia

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

daxiongYang 7 vuotta sitten
vanhempi
commit
bc2df70584
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  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,7 +4,7 @@
4 4
    :index="menu.menuId + ''"
5 5
    :popper-class="'site-sidebar--' + sidebarLayoutSkin + '-popper'">
6 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 8
      <span>{{ menu.name }}</span>
9 9
    </template>
10 10
    <sub-menu
@ -15,7 +15,7 @@
15 15
    </sub-menu>
16 16
  </el-submenu>
17 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 19
    <span>{{ menu.name }}</span>
20 20
  </el-menu-item>
21 21
</template>

+ 2 - 2
src/views/main.vue

@ -69,8 +69,8 @@
69 69
        }).then(({data}) => {
70 70
          if (data && data.code === 0) {
71 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
      }