Browse Source

perf[css]: refine fade-transform

Pan 6 years ago
parent
commit
a91f687c2d
2 changed files with 16 additions and 1 deletions
  1. 14 0
      src/styles/transition.scss
  2. 2 1
      src/views/layout/components/AppMain.vue

+ 14 - 0
src/styles/transition.scss

@@ -11,6 +11,20 @@
   opacity: 0;
   opacity: 0;
 }
 }
 
 
+/*fade-transform*/
+.fade-transform-leave-active,
+.fade-transform-enter-active {
+  transition: all .5s;
+}
+.fade-transform-enter {
+  opacity: 0;
+  transform: translateX(-30px);
+}
+.fade-transform-leave-to {
+  opacity: 0;
+  transform: translateX(30px);
+}
+
 /*fade*/
 /*fade*/
 .breadcrumb-enter-active,
 .breadcrumb-enter-active,
 .breadcrumb-leave-active {
 .breadcrumb-leave-active {

+ 2 - 1
src/views/layout/components/AppMain.vue

@@ -1,6 +1,7 @@
 <template>
 <template>
   <section class="app-main">
   <section class="app-main">
-    <transition name="fade" mode="out-in">
+    <transition name="fade-transform" mode="out-in">
+      <!-- or name="fade" -->
       <!-- <router-view :key="key"></router-view> -->
       <!-- <router-view :key="key"></router-view> -->
       <router-view/>
       <router-view/>
     </transition>
     </transition>