Guest User

Untitled

a guest
Jan 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <template>
  2. <div class="home">
  3. <transition name="section">
  4. <component :is="activeSection"></component>
  5. </transition>
  6. </div>
  7. </template>
  8.  
  9. <script>
  10. import comp1 from './comp1';
  11. import comp2 from './comp2';
  12.  
  13. export default {
  14. components: {
  15. comp1,
  16. comp2
  17. },
  18. data() {
  19. activeSection: 'comp1'
  20. }
  21. </script>
  22.  
  23. <style scoped>
  24. .section-enter {
  25. top: 100vh;
  26. }
  27. .section-enter-to {
  28. top: 0vh;
  29. }
  30. .section-enter-active {
  31. animation-name: 'slideIn';
  32. animation-duration: 1s;
  33. }
  34. .section-leave {
  35. top: 0vh;
  36. }
  37. .section-leave-active {
  38. animation-name: 'slideOut';
  39. animation-duration: 1s;
  40. }
  41. .section-enter-to {
  42. top: -100vh;
  43. }
  44.  
  45.  
  46. @keyframes slideIn {
  47. from {
  48. top: 100vh;
  49. }
  50. to {
  51. top: 0
  52. }
  53. }
  54.  
  55. @keyframes slideOut {
  56. from {
  57. top: 0vh;
  58. }
  59. to {
  60. top: -100vh;
  61. }
  62. }
  63. </style>
Add Comment
Please, Sign In to add comment