Browse Source

chore: update

xiaoxian521 2 years ago
parent
commit
d5d7dd8e57
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/layout/components/sidebar/leftCollapse.vue

+ 6 - 0
src/layout/components/sidebar/leftCollapse.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { ref } from "vue";
 import { useNav } from "@/layout/hooks/useNav";
 import MenuFold from "@iconify-icons/ri/menu-fold-fill";
 import MenuUnfold from "@iconify-icons/ri/menu-unfold-fill";
@@ -10,6 +11,8 @@ interface Props {
 const props = withDefaults(defineProps<Props>(), {
   isActive: false
 });
+
+const visible = ref(false);
 const { tooltipEffect } = useNav();
 
 const emit = defineEmits<{
@@ -25,6 +28,7 @@ const toggleClick = () => {
   <div class="container">
     <el-tooltip
       placement="right"
+      :visible="visible"
       :effect="tooltipEffect"
       :content="props.isActive ? '点击折叠' : '点击展开'"
     >
@@ -32,6 +36,8 @@ const toggleClick = () => {
         :icon="props.isActive ? MenuFold : MenuUnfold"
         class="cursor-pointer inline-block align-middle text-primary hover:text-primary dark:hover:!text-white w-[16px] h-[16px] ml-4 mb-1"
         @click="toggleClick"
+        @mouseenter="visible = true"
+        @mouseleave="visible = false"
       />
     </el-tooltip>
   </div>