Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div class="home">
- <transition name="section">
- <component :is="activeSection"></component>
- </transition>
- </div>
- </template>
- <script>
- import comp1 from './comp1';
- import comp2 from './comp2';
- export default {
- components: {
- comp1,
- comp2
- },
- data() {
- activeSection: 'comp1'
- }
- </script>
- <style scoped>
- .section-enter {
- top: 100vh;
- }
- .section-enter-to {
- top: 0vh;
- }
- .section-enter-active {
- animation-name: 'slideIn';
- animation-duration: 1s;
- }
- .section-leave {
- top: 0vh;
- }
- .section-leave-active {
- animation-name: 'slideOut';
- animation-duration: 1s;
- }
- .section-enter-to {
- top: -100vh;
- }
- @keyframes slideIn {
- from {
- top: 100vh;
- }
- to {
- top: 0
- }
- }
- @keyframes slideOut {
- from {
- top: 0vh;
- }
- to {
- top: -100vh;
- }
- }
- </style>
Add Comment
Please, Sign In to add comment