Browse Source

默认选择节点高亮不完整

liuQiang 1 year ago
parent
commit
14697183cc
1 changed files with 12 additions and 2 deletions
  1. 12 2
      src/components/LeftList/LeftList.vue

+ 12 - 2
src/components/LeftList/LeftList.vue

@@ -15,7 +15,7 @@
     >
       <template #default="{ node, data }">
         <span
-          class="custom-tree-node"
+          class="custom-tree-node row-context"
           :class="{ alive: data.id == collectDir }"
           @click="checkoutNode(node, data)"
           @click.right="rightFn(node, data, $event)"
@@ -226,7 +226,7 @@ watch(
   () => props.collectId,
   (newValue, oldValue) => {
     // console.log("watch", newValue);
-    collectDir.value  = newValue;
+    collectDir.value = newValue;
     curArr.value.push(newValue);
     // proxy.$refs["folderTreeRef"].filter(newValue);
   },
@@ -249,6 +249,12 @@ onMounted(() => {
   overflow-y: auto;
   position: relative;
 }
+// .row-context {
+//    background: #f4f9ff;
+//    width: auto;
+//    border: 1px solid #4a97eb;
+//    padding: 5px 5px 5px 0;
+//  }
 .custom-tree-node {
   width: 100%;
   height: 36px;
@@ -335,4 +341,8 @@ onMounted(() => {
   width: 18px;
   height: 18px;
 }
+:deep(.el-tree-node) {
+  min-width: 100% !important;
+  width: fit-content !important;
+}
 </style>