Преглед на файлове

优化元素动画选择面板体验

pipipi-pikachu преди 5 години
родител
ревизия
1f227e19ae
променени са 1 файла, в които са добавени 12 реда и са изтрити 7 реда
  1. 12 7
      src/views/Editor/Toolbar/ElementAnimationPanel.vue

+ 12 - 7
src/views/Editor/Toolbar/ElementAnimationPanel.vue

@@ -10,15 +10,20 @@
                 <div 
                   class="pool-item" 
                   v-for="item in type.children" :key="item.name"
-                  :class="[
-                    'animate__animated',
-                    'animate__faster',
-                    hoverPreviewAnimation === item.value && `animate__${item.value}`,
-                  ]"
-                  @mouseover="hoverPreviewAnimation = item.value"
+                  @mouseenter="hoverPreviewAnimation = item.value"
+                  @mouseleave="hoverPreviewAnimation = ''"
                   @click="addAnimation(item.value)"
                 >
-                  {{item.name}}
+                  <div 
+                    class="animation-box"
+                    :class="[
+                      'animate__animated',
+                      'animate__faster',
+                      hoverPreviewAnimation === item.value && `animate__${item.value}`,
+                    ]"
+                  >
+                    {{item.name}}
+                  </div>
                 </div>
               </div>
             </div>