소스 검색

菜单栏修改

1178232204@qq.com 3 년 전
부모
커밋
61cc4fd470
2개의 변경된 파일6개의 추가작업 그리고 12개의 파일을 삭제
  1. 5 10
      src/components/common/HomePage.vue
  2. 1 2
      src/less/common.less

+ 5 - 10
src/components/common/HomePage.vue

@@ -188,14 +188,7 @@ export default {
     this.getMenuList();
   },
   mounted() {
-    let elSide = document.querySelector('.el-aside'),
-      tabWidth = document.querySelector('.collect-left');
-    tabWidth.style.left = elSide.offsetWidth - 36 + 'px';
-    window.onresize = () => {
-      return (() => {
-        tabWidth.style.left = elSide.offsetWidth - 36 + 'px';
-      })();
-    };
+    
   },
   watch: {
     $route: function(to, from) {
@@ -211,7 +204,9 @@ export default {
   },
   methods: {
     collect() {
+      let tabWidth = document.querySelector(".collect-left");
       this.onshow = !this.onshow;
+      tabWidth.style.left = this.onshow ? 300 - 36 + "px" : 300 + "px";
     },
     CalcuMD5(password) {
       password = md5(password);
@@ -360,7 +355,7 @@ export default {
   width: 36px;
   height: 32px;
   position: fixed;
-  // left: calc(20% - 36px);
+  left: 264px;
   top: 65%;
   z-index: 20;
 }
@@ -412,7 +407,7 @@ export default {
 .version {
   position: fixed;
   bottom: 0;
-  width: @aside-width;
+  width: 300px;
   min-width: 270px;
   font-size: 12px;
   /*text-indent: 50px;*/

+ 1 - 2
src/less/common.less

@@ -42,8 +42,7 @@
 
 .el-aside {
   background: #fff;
-  min-width: @aside-min-width;
-  width: @aside-width !important;
+  width: 300px;
   min-height: 220px;
   border-right: 1px @gray solid;
   height: 100%;