I am attempting to create a simple collapsible menu transition. The code for my element is as follows:
<transition name="settings">
<div v-show="!settingsCollapsed">
</div>
</transition>
Here is the CSS associated with it:
.settings-enter {
max-height: 0px;
}
.settings-enter-active {
max-height: 200px;
transition: all 1s;
}
.settings-leave {
max-height: 200px;
}
.settings-leave-active {
max-height: 0;
transition: all 1s;
}
While the menu slides up correctly, there seems to be an issue when it's sliding down as the animation doesn't occur smoothly. It looks like .settings-enter
class is skipped and only .settings-enter-active
is applied directly after being hidden.
If you have any suggestions on how I can resolve this problem or if there are alternative methods for animating a collapsible menu, please let me know!