What is the best way to use the .animate
function on an element in vuejs?
<aside v-transition v-if="toggleMenu">
<a href="#">Haha</a>
<a href="#">Nice</a>
<a href="#">Menu</a>
</aside>
A similar piece of JavaScript code looks like this:
if (toggleMenu) {
$('aside').animate({width: 'toggle'}, 200);
}
I have attempted to bind the style
attribute, as shown below:
<aside v-transition :style="{width: toggleMenu?'toggle':'200px'}">
Unfortunately, this approach fails to animate. I am striving to achieve a similar effect to the one showcased in this CodePen example through vue.