Prechádzať zdrojové kódy

fix html transition

Martin Kunz 10 mesiacov pred
rodič
commit
7857af5ba6
1 zmenil súbory, kde vykonal 11 pridanie a 2 odobranie
  1. 11 2
      src/components/VCollaps.vue

+ 11 - 2
src/components/VCollaps.vue

@@ -31,7 +31,7 @@ function toggle () {
         <div class="collapse-header" :class="{ 'is-active': active }"></div>
       </div>
       <Transition name="fade">
-        <div class="collapse-content" v-if="active">
+        <div class="collapse-content" v-show="active">
           <div class="collapse-content-box">
             <slot></slot>
           </div>
@@ -51,8 +51,17 @@ function toggle () {
     content: url('../assets/arrow-down.svg');
     transform: rotate(-90deg);
 }
-
 .is-active  {
     transform: rotate(0deg);
 }
+
+.fade-enter-active,
+.fade-leave-active {
+  transition: opacity 0.2s ease;
+}
+
+.fade-enter-from,
+.fade-leave-to {
+  opacity: 0
+}
 </style>