Skip to content
Advertisement

Vue – apply transition to menu element

I have this scss code in my vue app. I’m trying to make a smooth transition from left for a menu when the isVisible property is set to true but I’m not able to apply the transition I’ve defined and the menu will instantly appear. I’ve done a reserach here on SO and I’ve found some interesting questions but all of them are using jQuery and css animation so they are not really useful. I’m not a CSS master, any suggestion about?

HTML

JavaScript

CSS

JavaScript

Advertisement

Answer

This is done with <transition>

Here an example:

JavaScript

CSS class

JavaScript

Its really not that hard

Take a look: https://v2.vuejs.org/v2/guide/transitions.html

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement