feat: add global page toggling animation

master
chenghx 6 years ago
parent a514bb4197
commit bf932950d6
  1. 13
      src/App.vue
  2. 2
      src/components/layout/MenuView.vue
  3. 4
      src/components/layout/PageView.vue
  4. 2
      src/components/layout/RouteView.vue

@ -19,8 +19,8 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
//
:global{ :global{
//
.dragable-ghost{ .dragable-ghost{
border: 1px dashed #aaaaaa; border: 1px dashed #aaaaaa;
opacity: 0.65; opacity: 0.65;
@ -33,5 +33,16 @@ export default {
border: 1px dashed #aaaaaa; border: 1px dashed #aaaaaa;
opacity: 0.65; opacity: 0.65;
} }
//
.page-toggle-enter-active{
transition: all 0.2s ease-in 0.25s;
}
.page-toggle-leave-active{
transition: all 0.2s ease-out 0s;
}
.page-toggle-enter, .page-toggle-leave-to{
opacity: 0;
padding: 0px;
}
} }
</style> </style>

@ -1,6 +1,8 @@
<template> <template>
<global-layout> <global-layout>
<transition name="page-toggle">
<router-view /> <router-view />
</transition>
</global-layout> </global-layout>
</template> </template>

@ -3,7 +3,9 @@
<div slot="extra" class="extraImg"> <div slot="extra" class="extraImg">
<img :src="extraImage"/> <img :src="extraImage"/>
</div> </div>
<router-view ref="page"/> <transition name="page-toggle">
<router-view ref="page"/>
</transition>
</page-layout> </page-layout>
</template> </template>

@ -1,5 +1,7 @@
<template> <template>
<transition name="page-toggle">
<router-view /> <router-view />
</transition>
</template> </template>
<script> <script>

Loading…
Cancel
Save