Перемудрил как-то с этим TWEEN. Попробуй
gsap, получится гораздо проще.
import {TimelineMax} from "gsap";
export default {
props: [],
data () {
return {
blocks: [
{title: 'one', content: 'lorem three...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...', show: false},
{title: 'two', content: 'lorem three...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...', show: false},
{title: 'three', content: 'lorem three...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...lorem two...', show: false}
]
}
},
methods: {
switchBlock (n) {
if (this.blocks[n].show === true) {
this.blocks[n].show = false;
}
else {
this.blocks.forEach(function(block) {
block.show = false;
});
this.blocks[n].show = true;
}
},
enter (el, done) {
new TimelineMax()
.from(el, .5, {
height: 0
});
},
leave (el, done) {
new TimelineMax()
.to(el, .5, {
height: 0
});
}
}
}