3👍
The issues is that your layout does not reflow due to the nature of the transform
property after the .list-item
s are added to your .blocks
s. You can read about 3 diff techniques that could be used for what you are doing here.
My suggestion to use the min-height
property instead and get rid of the Vue transition and simply toggle the class on your .list
node. Below are the adjustments that you’d need:
CSS:
// strip all of the .slide-out-* classes
.list {
....
max-height: 100px;
transition: all 1s;
}
.block .list.is-collapsed {
transition: all 1s;
max-height: 0;
padding-top: 0;
padding-bottom: 0;
}
HTML:
remove tags &
<div class="list" :class="{'is-collapsed': collapsed}"> <--- removed 'v-if'
👤i–
- [Vuejs]-Why "Vue is not defined" when using Vue 3 + Vuex 4?
- [Vuejs]-Binding local image using v-for – vuejs
3👍
You could also animate the margin property at the same time as translating. See this codepen example
basically just change your enter
and leave-to
css to something like this
.slide-out-enter,
.slide-out-leave-to {
opacity: 0;
transform: translateY(-100px);
margin-bottom: -100px;
}
- [Vuejs]-How to concatenate two fields in v-autocomplete item-text vuetify
- [Vuejs]-Cypress component testing with Vue-I18N
Source:stackexchange.com