Skip to content

Commit

Permalink
feat(app): add transition for router-view
Browse files Browse the repository at this point in the history
  • Loading branch information
rudnovd authored Jun 11, 2021
1 parent 03076eb commit 76d0cc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 15 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<img src="~@/assets/icons/arrow_back.svg" width="16" height="16" />
Home page
</router-link>
<router-view />
<transition name="transition-router">
<main>
<router-view />
</main>
</transition>
</template>

<script lang="ts">
Expand Down Expand Up @@ -45,4 +49,14 @@ export default defineComponent({
height: 2rem;
}
}
.transition-router-enter-active,
.transition-router-leave-active {
transition: opacity 0.5s ease;
}
.transition-router-enter-from,
.transition-router-leave-to {
opacity: 0;
}
</style>
3 changes: 2 additions & 1 deletion src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

html,
body,
#app {
#app,
main {
height: 100%;
line-height: 1.5;
}
Expand Down

0 comments on commit 76d0cc7

Please sign in to comment.