That's the complete source code with comments from the video tutorial Menu Animation with Vue
Menu Animation with Vue transitions. This nice animated accordion here has a smooth opening and closing transition. On top, you have an arrow for each element, which rotates if you click an item in the list.
Now, if you need to animate an HTML element from zero height to its natural height, then that can be quite problematic. The element just appears directly, instead of an animation.
There are some solutions to fix this age-old problem, like if you use the min-height attribute or the scaling with transform, but all of these methods have their disadvantages. So using JavaScript for triggering and controlling transitions is almost essential.
And Vue.js provides us a beautiful transition component which makes animating HTML elements a very pleasant experience. So there are hardly any reasons not to use JavaScript to animate elements if you are using Vue JS.
Learn Vue JS - From The Ground Up
Learn Vue JS - Additional Libaries
Vue JS Animations and Transitions
Learn Nuxt JS - From The Ground Up
npm install
npm run serve
npm run build
npm run test
npm run lint