add side bar transition effect

This commit is contained in:
nasum 2018-04-13 18:01:19 +09:00
parent 00544d22b8
commit 9f9b858435
2 changed files with 18 additions and 6 deletions

View File

@ -34,12 +34,14 @@ export default {
height: 100%;
width: 100%;
overflow: auto;
transition: all 0.5s;
}
.timeline-wrapper-with-side-bar {
height: 100%;
width: -webkit-calc(100% - 320px);
overflow: auto;
transition: all 0.5s;
}
}
</style>

View File

@ -1,11 +1,13 @@
<template>
<div id="side_bar" v-if="openSideBar">
<div class="header">
<i class="el-icon-close" @click="close"></i>
<transition name="slide-detail">
<div id="side_bar" v-if="openSideBar">
<div class="header">
<i class="el-icon-close" @click="close"></i>
</div>
<account-profile v-if="component === 1"></account-profile>
<toot-detail v-if="component === 2"></toot-detail>
</div>
<account-profile v-if="component === 1"></account-profile>
<toot-detail v-if="component === 2"></toot-detail>
</div>
</transition>
</template>
<script>
@ -55,4 +57,12 @@ export default {
}
}
}
.slide-detail-enter-active, .slide-detail-leave-active {
transition: all 0.5s;
}
.slide-detail-enter, .slide-detail-leave-to {
margin-right: -320px;
opacity: 0;
}
</style>