From the course: Vue.js 2 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Managing styles with JavaScript

Managing styles with JavaScript

From the course: Vue.js 2 Essential Training

Start my 1-month free trial

Managing styles with JavaScript

- [Instructor] Transitions and transition groups also create different events that we can track and modify what's happening with our application and our animations. So let's take a look at how that works. Now to do that, I'm going to go into my transition group, which is right here, and I'll get rid of some of these items right here. These animations are now going to be controlled with JavaScript. So I don't need these two right here, and what I'll do is I will use the events that are available, and they look just like the classes that we've been using. So you can say beforeEnter, and we can execute a method. We'll just call it beforeEnter, but you could call it whatever you want. And, then we'll create some other event here, so these are clearly the same thing as typing v-on and then colon. So the shortcut for that is the @ sign, and we'll do whenever we enter, we'll execute a method we'll call, also, enter. And, finally, when we say leave, we'll execute another method called leave…

Contents