Browse Source

侧边栏显示登录和

小宝贝 1 year ago
parent
commit
d777aa4211
2 changed files with 7 additions and 1 deletions
  1. 1 0
      ruoyi-ui/src/layout/components/Sidebar/index.vue
  2. 6 1
      ruoyi-ui/src/layout/index.vue

+ 1 - 0
ruoyi-ui/src/layout/components/Sidebar/index.vue

@@ -11,6 +11,7 @@
                 :active-text-color="settings.theme"
                 :collapse-transition="false"
                 mode="vertical"
+                menu-trigger="click"
             >
                 <sidebar-item
                     v-for="(route, index) in sidebarRouters"

+ 6 - 1
ruoyi-ui/src/layout/index.vue

@@ -17,7 +17,7 @@
               <div class="avatar-wrapper">
                 <img :src="avatar" class="user-avatar" />
                 <span style="">
-                  <button class="jianbiase">{{userName}}</button>
+                  <button class="jianbiase">{{userName || '默认用户'}}</button>
                 </span>
                 <i class="el-icon-caret-bottom" />
               </div>
@@ -87,6 +87,11 @@ export default {
     Sidebar,
     TagsView,
   },
+  data() {
+    return {
+      userName: '默认用户',
+    };
+  },
   mixins: [ResizeMixin],
   computed: {
     ...mapState({