瀏覽代碼

style: perf sidebar style (#95)

一万 3 年之前
父節點
當前提交
e0551251d3
共有 1 個文件被更改,包括 11 次插入8 次删除
  1. 11 8
      src/layout/components/sidebar/sidebarItem.vue

+ 11 - 8
src/layout/components/sidebar/sidebarItem.vue

@@ -112,8 +112,11 @@ function resolvePath(routePath) {
             <template #content> {{ $t(onlyOneChild.meta.title) }} </template>
             <span
               ref="menuTextRef"
-              style="overflow: hidden; text-overflow: ellipsis"
-              :style="pureApp.sidebar.opened ? 'width: 125px' : ''"
+              :style="{
+                width: pureApp.sidebar.opened ? '125px' : '',
+                overflow: 'hidden',
+                textOverflow: 'ellipsis'
+              }"
               @mouseover="hoverMenu(onlyOneChild)"
             >
               {{ $t(onlyOneChild.meta.title) }}
@@ -148,12 +151,12 @@ function resolvePath(routePath) {
         <template #content> {{ $t(props.item.meta.title) }} </template>
         <div
           ref="menuTextRef"
-          style="
-            display: inline-block;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            width: 125px;
-          "
+          :style="{
+            width: pureApp.sidebar.opened ? '125px' : '',
+            display: 'inline-block',
+            overflow: 'hidden',
+            textOverflow: 'ellipsis'
+          }"
           @mouseover="hoverMenu(props.item)"
         >
           <span style="overflow: hidden; text-overflow: ellipsis">